cs331-102-ch20

Download Report

Transcript cs331-102-ch20

Chapter 20
Network Layer:
Internet Protocol
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
20-1 INTERNETWORKING
In this section, we discuss internetworking, connecting
networks together to make an internetwork or an
internet.
Topics discussed in this section:
(Study from Book)
Need for Network Layer
Internet as a Datagram Network
Internet as a Connectionless Network
Figure 20.1 Links between two hosts
Figure 20.2 Network layer in an internetwork
Figure 20.3 Network layer at the source, router, and destination
Figure 20.3 Network layer at the source, router, and destination (continued)
Note
Switching at the network layer in the
Internet uses the datagram approach to
packet switching.
Note
Communication at the network layer in
the Internet is connectionless.
20-2 IPv4
The Internet Protocol version 4 (IPv4) is the delivery
mechanism used by the TCP/IP protocols.
Topics discussed in this section: study from lecure notes
IP Datagram
ARP
Figure 20.4 Position of IPv4 in TCP/IP protocol suite
Figure 20.5 IPv4 datagram format
IPv4 datagram fields








Minimum Header length is 20 bytes without options.
With options the maximum can go to 60 bytes
Largest data that can be carried in the datagram is 65535 – 20
= 65515
Version field: will carry the version number which is 4 =
(0100)2
Header length: the length of the header in bytes after dividing
it by 4. Min is 20/4 = 5 = (0101)2 and the max is 60/4 = 15 =
(1111 )2
Total length: total length of the packet: header + data. Max =
65535 bytes
Identification, flags, and offset used for fragmentation and
reassembly at the destination.
Packet can be fragmented at any node between the source
and the destination but reassembly is done ONLY at the
destination node.
IPv4 datagram fields



Time to Live: is used to prevent lost packets from
circulating between routers forever. This field is set
to certain value depending on the device operating
system. Each router will decrement this field by one
and check the value. If the value is zero the packet
will be dropped.
Protocol: contains a code for what is being carried in
the data field. Refer to table (20.4) and Figure (20.8)
Header checksum: used for checking if there is error
in the header only. The checksum is recomputed at
each router between the source and the destination.
Fragmentation




The Internet Protocol (IP) implements datagram
fragmentation, so that packets may be formed that can pass
through a physical network with a smaller maximum
transmission unit (MTU) than the original datagram size.
The Identification field, and Fragment offset field along with
Don't Fragment and More Fragment flags in the IP protocol
header are used for fragmentation and reassembly of IP
datagrams.
The value of MTU depends on the physical network protocol.
In a case where a router receives a packet larger than the next
hop's MTU, it has two options if the protocol is IPv4. Drop
the PDU and send an Internet Control Message Protocol
(ICMP) message which indicates the condition Packet too Big,
or to fragment the IP packet and send it over the link with a
smaller MTU.
Figure 20.8 Protocol field and encapsulated data
Table 20.4 Protocol values in Hex
Figure 20.9 Maximum transfer unit (MTU)
Table 20.5 MTUs for some networks
Fragmentation and Reassembly
 Fragmentation takes place at the sender and routers
 Reassembly takes place at the receiver ONLY.
Fragment
at source
Reassemble
at destination
Source
IP
Router
Destination
Fragment
at router
Network
IP
Network
21.1 Address Resolution Protocol (ARP)


At the network level hosts and routers are
recognized by their IP address
Packets must pass through physical networks to
reach hosts and routers.


At the physical network, hosts and routers are
recognized by their MAC addresses which is local
address.
ARP is a network layer protocol that translates
between Internet IP address and MAC sublayer
(layer-2) address
Figure 21.1 ARP operation