You are on page 1of 15

CS65-Computer Networks Dept.

of EEE

AN INTERNET

INTERNETWORKING

3/2/2011 1 3/2/2011 2

PRINCIPLES OF INTERNETWORKING DIFFERENCES AMONG NETWORKS

REQUIREMENTS ON INTERNETWORKING FACILITY: • Different addressing schemes


• Different maximum packet size
• Provide a link between networks. • Different network access mechanisms
• Provide for the routing and delivery of data between • Different timeouts
processes on different networks • Error recovery
• Provide an accounting service that keeps track of the use • Status reporting
of the various networks and gateways and maintains • Routing techniques
status information.
• User access control
• Internetworking facility must accommodate a number of
• Connection, connectionless.
differences among networks.

3/2/2011 3 3/2/2011 4

S.Muralidharan 1
CS65-Computer Networks Dept. of EEE

Different Approaches Network layer at the source, router, and destination

• END-TO-END APPROACH
– The end-to-end approach
assumes only that all networks
offer at least an unreliable
datagram service. Hence
necessary care should be taken
to deliver the packet till the
system level.

• NETWORK-BY-NETWORK
APPROACH
– In the network-by-network
approach, the technique is to
provide reliable service within
each network and then to merge
together individual network
connections across multiple
networks.
3/2/2011 5 3/2/2011 6

Network layer at the source Network layer at a router


– Network layer at the switch or router is
responsible for routing the packet.

3/2/2011 7 3/2/2011 8

S.Muralidharan 2
CS65-Computer Networks Dept. of EEE

Network layer at the destination • Implemented in two ways


– Using Bridges
– Using Internet Protocol(IP)

3/2/2011 9 3/2/2011 10

THE BRIDGE
• When bridges are powered on in an Ethernet network, they start to
• Why Bridges ? learn the network's topology by analysing the source addresses of
incoming frames from all attached network segments (a process
– Bridges are simplified gateway used to connect homogenous called backward learning ). Over a period of time, they build up a
networks. Such networks exhibit the same interface to attached routing table .
stations and use the same internal protocols. – Unless the source and the destination are on different network segments,
there is no need for the bridge to transfer an incoming frame to another
– Bridges can be used to connect two or more LAN segments of the network segment. If the source and the destination are on different
same type (e.g. Ethernet to Ethernet, or Token-Ring to Token- segments, the bridge needs to be able to determine which segment the
Ring). destination device belongs to.
– The bridge monitors all traffic on the segments it connects, and checks the
• Bridges Vs Repeaters source and destination address of each frame against its routing table. When
– Example is the “repeater” used in base band networks. However, the bridge first becomes operational, the routing table is blank, but as data is
transmitted back and forth, the bridge adds the source MAC address of any
this is not a true multiple network system. The repeater is merely incoming frame to the routing table and associates the address with the port
used to extend the length of the base band cable. It amplifies and on which the frame arrives. In this way, the bridge quickly builds up a
retransmits all signals, including collisions. Thus the system complete picture of the network topology. If the bridge does not know the
destination segment for an incoming frame, it will forward the frame to all
behaves like a single network. Moreover each port on a bridge has attached segments except the segment on which the frame was transmitted.
its own MAC address which is not the case of a repeater Bridges reduce the amount of traffic on individual segments by acting as a
filter, isolating intra-segment traffic. This can greatly improve response times.

3/2/2011 11 3/2/2011 12

S.Muralidharan 3
CS65-Computer Networks Dept. of EEE

• Learning of Bridges… • Because Ethernet bridges determine whether or not to


forward frames on the basis of the desination MAC
address, they are said to operate at the data link layer of
the OSI Reference Model. Etherenet bridges are
sometimes referred to as transparent , because their
presence and operation are transparent to network users,
although they successfully isolate intrasegment traffic,
reducing network traffic overall and improving network
response times.

3/2/2011 13 3/2/2011 14

3/2/2011 15 3/2/2011 16

S.Muralidharan 4
CS65-Computer Networks Dept. of EEE

INTERNET PROTOCOL (IP)


Other facts about bridges are : Operation of an IP in Internet :
– The bridge makes no modifications to the content or format of IP provides a connectionless datagram service
the frames it receives and encapsulate with an additional between stations.
header.
Advantages of IP are :
– The bridge should contain enough buffer space to meet peak
demands. – Since connectionless internet facility is flexible, it can deal
with a variety of networks.
– The bridge must contain addressing and routing intelligence.
– A connectionless internet service can be made highly robust.
– A bridge may connect more than two networks
• Reason for using bridges :
– Reliability
– Performance
– Security
– Convenience
– Geographic coverage

3/2/2011 17 3/2/2011 18

3/2/2011 19 3/2/2011 20

S.Muralidharan 5
CS65-Computer Networks Dept. of EEE

Sequence of events…

• Exchange between A on LAN1 and B on LAN2.


• The data to be sent by A are encapsulated in a datagram
• IP module in the sending station constructs the data gram
with an IP header specifying a global network address
(station B) with global network address and recognizes that the
destination is on another network. The IP module appends a
• This datagram is then encapsulated with the LAN 1
protocol and sent to a gateway that strips off the LAN1 header that contains the address of the gateway.
header. • The gateway unwraps the packet to recover the original
• The datagram is then encapsulated with the X.25 datagram. The gateway analyzes the IP header to determine
protocol and transmitted across the network to a whether this datagram contains control information intended
gateway. for the gateway or data intended for a station in another
• The gateway strips off the X.25 fields and recovers the network.
datagram, which is then wrapped in LAN2 headers and
sent to B.
• If a connection oriented service is required, A & B should
share a common layer 4 protocol.
3/2/2011 21 3/2/2011 22

Contd…
• In the latter instance, the gateway must make a routing
decision. There are four possibilities :
– The destination station is attached directly to one of the networks to
which the gateway is attached. This is referred as “directly
connected”.
– The destination station is on a network that has a gateway that
directly connects to this gateway. This is known as a “neighbor
gateway”
– To reach the destination station, more than one additional gateway
must be traversed. This is known as a “multiple-hop” situation.
– The gateway does not know the destination address.

• All stations labeled S0 are directly connected to gateway G1- directly connected
• G2 is a neighbor gateway of G1. All stations labeled as S1 are one “hop” from G1
• All stations labeled S2 are “multiple-hop”
3/2/2011 23 3/2/2011 24

S.Muralidharan 6
CS65-Computer Networks Dept. of EEE

• In case 4, the gateway returns an error message to the • Before actually sending data, the gateway must need to
source of the datagram. segment the datagram to accommodate a smaller packet
• For case 1 to 3, the gateway must select appropriate route size limitation on the outgoing network.
for the data, and insert them into the appropriate network • Each segment becomes an independent IP datagram.
with the appropriate address. • The gateway then queues each packet for transmission. It
• For case 1, the address is the destination address. may also enforce a maximum queue length. Once that limit
is reached, additional datagrams are simply dropped.
• For case 2 and 3, the address is a gateway address
• The process described above continues through zero or
more gateways until the datagram reaches the destination
station.
• The destination station recovers the IP datagram from its
network wrapping.
• If segmentation has occurred, the IP module in the
destination station buffers the incoming data until the
original data field is reassembled.
3/2/2011 25 3/2/2011 26

IPv4 FRAME FORMAT


• Protocol format includes
– Version (4-bits):
• The current protocol version is 6.
• Including a version number allows a future version of IP be
used along side the current version, facilitating migration to
new protocols.
– Internet header length (4-bits):
• Length of the datagram header (excluding data) in 32-bit
words.
• The minimum length is 5 words = 20 bytes, but can be up to
15 words if options are used.
• In practice, the length field is used to locate the start of the
data portion of the datagram
– Service
• This is an 8-bit field.
• Previously it was called as “SERVICE TYPE”, now it is called
“DIFFERENTIATED SERVICES”
3/2/2011 27 3/2/2011 28

S.Muralidharan 7
CS65-Computer Networks Dept. of EEE

• Type of service(8-bits):
Precedence (3-bits): A priority indication, where 0 is the lowest and
means normal service, while 7 is highest and is intended for network
control messages (e.g., routing, congestion control).
Delay (1-bit): An Application can request low delay service (e.g., for
interactive use).
Throughput (1-bit): Application requests high throughput.
Reliability (1-bit): Application requests high reliability
Cost (1-bit) : Application requests cost minimization.

Last three TOS bits will generally be mutually


exclusive. Does setting the low-delay bit
guarantee getting such service?
No. The type-of-service field is meant as
a request or hint to the routing algorithms, but
does not guarantee that your request can be
honored (e.g., there may not be a low-delay
path available).
3/2/2011 29 3/2/2011 30

– Differentiated services – Total length (16-bits):


• In this interpretation, the first 6 bits make up the “codepoint” subfield • Total length of the IP
and the last two bits are not used. “Codepoint” subfield can be used datagram (in bytes),
in two different ways. including data and header.
The size of the data portion
– When the 3 right-most bits are 0s, the 3 left-most bits are interpreted the
of the datagram is the total
same as the precedence bits in the service type interpretation.
length minus the size of the
– When the 3 right-most bits are not all 0s, the 6 bits define 64 services header.
based on the priority assignment by the Internet or local authorities
according to the following table

– Identification(16-bits),
Flags(3-bits),Fragment
offset (13-bits):
• These three fields are used
for fragmentation and
reassembly.
– The first category (numbered 0,2,4,…62 )contain 32 service types
assigned by Internet authorities. The second category (3,7,11,15,….63)
contain 16 services used by local authorities. Finally the third category
(1,5,9,…61) contain 16 services and also are temporary. They can be
used for experimental purposes.

3/2/2011 31 3/2/2011 32

S.Muralidharan 8
CS65-Computer Networks Dept. of EEE

– Gateways along a path are free to fragment datagrams as needed; hosts are
We need to know when we’ve received all of the fragments. To help with this,
required to reassemble fragments before passing complete datagrams to the higher
the flags field may contain:
layer protocols.
– A Don't Fragment indication(DF flag) (set by host, honored by
– Each fragment contains a complete copy of the original datagram header plus gateways). (A 1-bit flag.)
some portion of the data.
– A receiving host must match arriving fragments with the proper original datagram. – The More Fragments(MF flag) field indicates that another
fragment follows this one. This fragment is not the last fragment of
– These fragments may be out of order and interleaved with other fragments.
the original datagram.
– All fragments of a datagram will have the same source and destination IP address.
– But, other datagrams between those two machines will share these fields as well,
An unfragmented datagram has an offset of 0, and a More Fragment bit of 0.
so this is not enough. The last fragment of a fragmented datagram contains More Fragment = 0 and
– The identification field uniquely identifies fragments of the same original datagram.
the Offset = a non-zero number.
– Whenever a host sends a datagram, it sets the identification field of the outgoing Note: The total length field of the IP header refers to the current datagram, not the
datagram and increments its local identification counter. original. Thus, the More Fragment bit is needed in order for the recipient host to
determine when it has all fragments of a datagram
– The offset field Indicates where in the datagram this fragment belongs.
– When a gateway fragments a datagram, it sets the offset field of each fragment to
reflect at what data offset with respect to the original datagram the current fragment
belongs.
– Fragmentation occurs in 8-byte chunks, so the offset holds the “chunk number”.
– Gateways can further fragment fragments!
3/2/2011 33 3/2/2011 34

Contd…
Example 2 :
Example 1 :
ORIGINAL DATAGRAM
Original Frame:IHL = 5, Length = 656, Fragment Offset = 0, More = 0
Data Length 472
Fragment 1: IHL = 5, Length = 232, Fragment Offset = 0, More = 1
Fragment 2: IHL = 5, Length = 232, Fragment Offset = 29, More = 1 Offset 0
Fragment 3: IHL = 5, Length = 192, Fragment Offset = 58, More = 0 More 0
FIRST SEGMENT
Data Length 240
Offset 0
First fragment Secondfragment
More 1 Data length = 240 Data length = 232
Segment offset = 0 Segment offset = 30
More = 1 More = 0
SECOND SEGMENT
Data Length 232
Offset 30
More 0 Original datagram
Data length = 472
Segment offset = 0
More = 0

3/2/2011 35 3/2/2011 36

S.Muralidharan 9
CS65-Computer Networks Dept. of EEE

– Time to live (8 bits) : – Source address (32 bits) :


• A counter that is decremented by each gateway. • Coded to allow a variable allocation of bits to specify the network
• Should this hopcount reach 0, discard the datagram. and the station within the specified network
• Originally, the time-to-live field was intended to reflect real time. – Destination address (32 bits) :
• In practice, it is now a hopcount.
• As above
• The time-to-live field squashes looping packets.
• It also guarantees that packets don't stay in the network for
– Options
longer than 255 seconds, a property needed by higher layer IP datagrams allow the inclusion of optional, varying length fields that
protocols that reuse sequence numbers. need not appear in every datagram. We may sometimes want to
– Protocol(8 bits): send special information, but we don't want to dedicate a field in the
• What type of data the IP datagram carries (e.g., TCP, UDP, etc.). packet header for this purpose.
• Needed by the receiving IP to know the higher level service that
will next handle the data.
Options start with a 1-byte option code, followed by zero or more
– Header checksum (16 bits) : bytes of option data.
• Frame check sequence on the header only

3/2/2011 37 3/2/2011 38

The option code byte contains three parts:


– Padding
copy flag (1 bit): If 1, replicate option in each fragment of a fragmented • Used to ensure that the internet header ends on a 32 bit
datagram. That is, this option should appear in every fragment as well. If boundary
0, option need only appear in first fragment.
– Data
option class (2 bits): Purpose of option: • The field must be a multiple of eight bits in length. Total length of
the data field plus header is a maximum of 65,535 octets
0 = network control
1 = reserved
2 = debugging and measurement
3 = reserved

option number (5 bits): A code indicating the option's type.

3/2/2011 39 3/2/2011 40

S.Muralidharan 10
CS65-Computer Networks Dept. of EEE

3/2/2011 41 3/2/2011 42

DESIGN ISSUES ADDRESSING


• Essentials :
• Addressing – Name : what an object is
• Routing – address : where it is
• Segmentation and reassembly – routes : how to get there
• Datagram lifetime • In a single network distinction exists as
• Error control process/application, station and path to reach it.
• Flow control • In internet, the distinction is not clear. Here to transfer
data through gateway, two entities must be identified :
the destination network and destination station.

3/2/2011 43 3/2/2011 44

S.Muralidharan 11
CS65-Computer Networks Dept. of EEE

• The network address required by gateway can be • So gate way will receive an internet packet with a
specified by several ways. referent in the form net.station where net is the network
– The application can refer to a network by a unique number
address and station is the address of the individual
– The internet logic in the station can translate a network name
system.
into a network address. – Since each station has different processes running, identifying
the process becomes difficult
– A global station addressing scheme can be used. ie. Unique
identifier for each station. • So net.station.SAP could solve this problem. This
• The third approach was proposed by Ethernet makes the internet protocol as process to process
developers. It recommends a 48 bit address which can rather than station to station.
be used for 1014 unique referents – It is the responsibility of the internet layer to multiplex and de-
multiplex between various SAPs. This simplify the higher
– Advantage : it permits stations to move from one network to
layer’s task. This allows the usage of microprocessor hardware
another.
devices.
– Disadvantage : some central facility must manage the
assignment of names • However one or more directory servers are needed to
identify the net.station address.

3/2/2011 45 3/2/2011 46

ROUTING DATAGRAM LIFETIME

• Routing is accomplished by maintaining a routing table • If dynamic or alternate routing is used, the potential
in each station and gateways. exists for a data gram or some of its fragments to
• Routing table may be static or dynamic loop indefinitely through the internet.
– A static table could contain alternate routes if a gateway is • This is undesirable because
unavailable
– An endlessly circulating datagram consumes resources
– A dynamic table is more flexible in responding both to error and
congestion situations. – Transport layer operation depends on timer
• Routing table may also be used to support other internet
services such as security and priority
• Source routing – source station specifies the route by
including a sequential list of gateways in the data grams
• Route recording - To record a route, each gateway
appends its address to a list of addresses in the data
gram
3/2/2011 47 3/2/2011 48

S.Muralidharan 12
CS65-Computer Networks Dept. of EEE

SEGMENTATION & REASSEMBLY


• To avoid this datagram must be marked with
lifetime. • Variety of networks specify different maximum packet
• This is implemented in two ways : size. So packet has to be segmented in the gateways to
– Using hop count : Each time that a datagram passes
accommodate it in the network
through a gateway, the count is decremented. • Reassembly can be done either at the destination or at
– True Measure of time : This require that the gateways the immediately next gateway
must somehow know how long it has been since the data – Facts about destination reassembly :
gram or segment last crossed a gateway, in order to • Data can have smaller berth in the packet.
know by how much to decrement the lifetime field. This • This may affect the efficiency of some networks.
require global clocking mechanism. – Facts about gateway reassembly :
• Large buffers are required at gateways, otherwise there is a
possibility of deadlock
• All segments of a datagram must pass through the same gateway.
This inhibits the use of dynamic routing.

3/2/2011 49 3/2/2011 50

• Source station creates a datagram with ‘Data Length’


• OSI follow an efficient technique for segmentation using
equal to the entire length of the data field, with ‘Offset’=0
the following fields :
and a ‘More Flag’ set to false.
– ID :
• unique identification for station. • To segment it the gateway follows :
• It consists of source and destination address, an identifier of the – Create two new datagram and copy the header fields of the
protocol layer that generated the data, and a sequence number incoming datagram to both.
supplied by that protocol layer.
– Divide the data into two approximately equal portions along
– Data length :
a 64-bit boundary, placing one portion in each new
• Length of the data field in octets
datagram.
– Offset :
• It is the position a segment in the original datagram
– Set the ‘Data Length’ field of the first datagram to the length
of the inserted data and set the ‘More Flag’ to True. Offset
– More flag
field is unchanged
– Set the ‘Data Length’ field of the second datagram to the
length of the inserted data and add the length of the first
data portion divided by eight to the ‘Offset’ field. The ‘More
Flag’ remains the same.
3/2/2011 51 3/2/2011 52

S.Muralidharan 13
CS65-Computer Networks Dept. of EEE

SEGMENTATION EXAMPLE
ORIGINAL DATAGRAM
Data Length 472
Offset 0
More 0
FIRST SEGMENT
Data Length 240
Offset 0 First fragment
Data length = 240
Secondfragment
Data length = 232
Segment offset = 0 Segment offset = 30
More 1 More = 1 More = 0

SECOND SEGMENT
Data Length 232
Offset 30
More 0 Original datagram
Data length = 472
Segment offset = 0
3/2/2011 53 More = 0
3/2/2011 54

• During reassembly, as the segments with the same ID ERROR CONTROL


arrive, their data fields are inserted in the proper • When the data gram is discarded in the gateway, the
position in the buffer until the entire data gram is gateway should attempt to return some information to
reassembled. This is identified by the sequence of data the source. Based on this source may modify the
packet having ‘Offset’ of zero and ends with packet transmission strategy
having false ‘More Flag’.
• Data grams may be discarded because of
• Since connectionless service does not guarantee the
– Lifetime expires
delivery, some means is needed to decide to abandon a
reassembly effort. – Congestion
– This can be done with timer. Once the timer expires, all – Frame Check Sequence (FCS) error – here notification is not
received segments are discarded. possible because source address field may have been
– The destination IP can make use of the datagram lifetime damaged

3/2/2011 55 3/2/2011 56

S.Muralidharan 14
CS65-Computer Networks Dept. of EEE

FLOW CONTROL
• Def: Gateway
• A gateway is a collection of HW and SW
• It limits the rate of data transfer
resources that allows a node to communicate two
• For connectionless services this facility is limited dissimilar networks.

3/2/2011 57 3/2/2011 58

S.Muralidharan 15

You might also like