0% found this document useful (0 votes)
10 views

Network Layer (Part 1)

Uploaded by

madhavgoyal070
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

Network Layer (Part 1)

Uploaded by

madhavgoyal070
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Unit 3

Network Layer

Computer Networks
03-10-2024 1
Dr. Divya Lohani
Network Layer
✓ Network Layer Services & Design Issues
✓ IP Protocol
✓ IPv4 Addressing
✓ Internet Control Protocols
✓ Network Routing
✓ Network Layer Devices

Computer Networks
03-10-2024 2
Dr. Divya Lohani
Network Layer Design Issues
• Store-and-forward packet switching
• Services provided to Transport layer
• Implementation of connectionless service
• Implementation of connection-oriented service

Computer Networks
03-10-2024 3
Dr. Divya Lohani
Store-and-Forward Packet Switching
ISP’s equipment

Computer Networks
03-10-2024 4
Dr. Divya Lohani
Services Provided to the Transport Layer
• The services should be independent of the router technology.
• The transport layer should be shielded from the number, type,
and topology of the routers present.
• The network addresses made available to the transport layer
should use a uniform numbering plan, even across LANs and
WANs.

Computer Networks
03-10-2024 5
Dr. Divya Lohani
Connectionless Service

Routing within a datagram network


Computer Networks
03-10-2024 6
Dr. Divya Lohani
Connection-Oriented Service

Routing within a virtual-circuit network


Computer Networks
03-10-2024 7
Dr. Divya Lohani
Computer Networks
03-10-2024 8
Dr. Divya Lohani
The Internet is an interconnected
collection of many networks

Computer Networks
03-10-2024 9
Dr. Divya Lohani
Internet Protocol (IP)
• Data transmitted over an internet using IP is carried in messages called IP datagrams.
Like all network protocol messages, IP uses a specific format for its datagrams.
• IP is a relatively simple, connectionless, “unreliable” protocol. It operates on a best
effort delivery model.
• IPv4 datagram is conceptually divided into two pieces: the header and the payload. The
header contains addressing and control fields, while the payload carries the actual data
to be sent over the internetwork.
• Maximum Transmission Unit MTU – Maximum amount of data that can be
transferred in one physical frame on the network. For IEEE 802.3, the MTU is 1500
bytes.

Computer Networks
03-10-2024 10
Dr. Divya Lohani
Computer Networks
03-10-2024 11
Dr. Divya Lohani
IPv4 & IPv6
• IPv4 addresses are 32-bit long - expressed in dotted decimal
notation. Contain 232 addresses. Example- 192.0.2.126

• IPv6 addresses are 128-bit long - expressed in hexadecimal format


separated by colon. Contain 2128 addresses.
Example- 2001:0000:3238:DFE1:0063:0000:0000:FEFB

Computer Networks
03-10-2024 12
Dr. Divya Lohani
IPv4 Header Format

Computer Networks
03-10-2024 13
Dr. Divya Lohani
Version (4 bits): Identifies the version of IP used to generate the datagram.

Internet Header Length (IHL) (4 bits): Specifies the length of the IP header, in 32-bit words. This includes the
length of any options fields and padding. The minimum value for this field is 5 (0101)

Differentiated Services (8 bits): uses Differentiated Services Code Point (DSCP)(6 bits) for packet classification
purposes like expedite delivery or assured delivery. Explicit Congestion Notification (ECN) (2 bits) allows end-to-end
notification of network congestion without dropping packets. ECN is an optional feature that is only used when
both endpoints support it and are willing to use it.

Total Length (TL) (16 bits): Specifies the total length of the IP datagram, in bytes.

Computer Networks
03-10-2024 14
Dr. Divya Lohani
Identification (16 bits): contains a 16-bit value that is common to each of the fragments belonging to a particular
message.

Flags (3 bits): Used to control or identify fragments. They are (in order, from high order to low order):
bit 0: Reserved; must be zero.
bit 1: Don’t Fragment (DF) - When an IP datagram has its DF flag set, intermediate devices are not allowed to
fragment it .
bit 2: More Fragments (MF) - MF flag is set to indicate the receiver that the current datagram is a fragment of
some larger datagram.

Fragment Offset (13 bits): Measured in units of eight-byte blocks, specifies the offset of a particular fragment
relative to the beginning of the original unfragmented IP datagram.
Computer Networks
03-10-2024 15
Dr. Divya Lohani
Time To Live (TTL) (8 bits): Specifies how long the datagram is allowed to “live” on the network, in terms of
router hops(0-255).

Protocol (8 bits): Identifies the higher level protocol (generally either a transport layer protocol or encapsulated
network layer protocol) used in the data portion of the IP datagram.

Header Checksum (16 bits): A 16 bit checksum computed over the header to provide basic protection against
corruption in transmission. The data is not check summed, only the header.

Computer Networks
03-10-2024 16
Dr. Divya Lohani
Source Address (32 bits): 32-bit IP address of the originator of the datagram.

Destination Address (32 bits): 32-bit IP address of the intended recipient of the datagram.

Options and Padding: One or more of several types of options may be included after the standard headers in
certain IP datagrams.

Computer Networks
03-10-2024 17
Dr. Divya Lohani
Internet Control Protocols

Computer Networks
03-10-2024 18
Dr. Divya Lohani
Internet Control Message Protocol (ICMP)
• Used to communicate IP status and error messages between host and
routers.
• Uses IP to route its messages between hosts.

Computer Networks
03-10-2024 19
Dr. Divya Lohani
• ICMP messages are divided into two broad categories: error-
reporting messages and query messages.

Category Type Message


3 Destination unreachable
4 Source quench
Error Reporting
11 Time exceeded
Messages
12 Parameter problem
5 Redirection
8 or 0 Echo request or reply
Query Messages 13 or 14 Timestamp request or
reply

Computer Networks
03-10-2024 20
Dr. Divya Lohani
Computer Networks
03-10-2024 21
Dr. Divya Lohani
Dynamic Host Configuration Protocol (DHCP)
• A network management protocol used to dynamically assign an IP address to
any device, on a network so it can communicate using IP.
• It is possible to manually configure each computer, but that is tedious and error-prone.
• There is a better way, and it is called DHCP (Dynamic Host Configuration Protocol).

• ARP (as well as other Internet protocols) makes the assumption that hosts are
configured with some basic information, such as their own IP addresses.
• DHCP is used by ISPs to set the parameters of devices over the Internet access
link - include network mask, IP address of the default gateway router, and IP
addresses of DNS and time servers.

Computer Networks
03-10-2024 22
Dr. Divya Lohani
• Every network should have a DHCP server that is responsible for configuration:
• If not on the same LAN as the requesting host, a DHCP relay agent is needed on each LAN (DHCP server may not be reachable by
broadcasting).

• An issue that arises with automatic assignment of IP addresses from a pool is for how long an IP address should be allocated:
• IP address assignment may be for a fixed period of time, a technique called leasing.
• Just before the lease expires, the host must ask for a DHCP renewal. If it fails to make a request or the request is denied, the host may
no longer use the IP address it was given earlier.

DHCP OFFER
DHCP DISCOVER

DHCP ACK

DHCP REQUEST
Computer Networks
03-10-2024 23
Dr. Divya Lohani
Address Resolution Protocol (ARP)
• Data link layer hardware does not understand Internet addresses.
• ARP protocol maintains a cache of IP-to-MAC address translation
pairs on your computer.
• Most hosts at companies and universities are attached to a LAN by an
interface board that only understands MAC addresses.
• send and receive frames based on 48-bit Ethernet addresses. They know
nothing at all about 32-bit IP addresses.
• ARP solves the problem of finding out which Ethernet/MAC address
corresponds to a given IP address.

Computer Networks
03-10-2024 24
Dr. Divya Lohani
Working of ARP
• When a source device wants to communicate with another device, it checks its Address Resolution Protocol (ARP) cache to find if it
already has a resolved MAC Address of the destination device. If it is there, it will use that MAC Address for communication.

• If not, source machine generates an ARP request message. The source broadcasts the ARP request message to the local network.

• When the targeted device checks the Target IP address, it generates an ARP reply message. The destination device will update its
ARP cache, since it need to contact the sender machine soon. Destination device sends the ARP reply message as a unicast.

• The source machine will process the ARP reply from destination, it stores the Sender Hardware Address as the MAC address of the
destination and updates its ARP cache.

Computer Networks
03-10-2024 25
Dr. Divya Lohani
• How do IP addresses get mapped onto data link layer addresses, such as
Ethernet?
• ARP solves the problem of finding out which Ethernet address corresponds to a given
IP address.

• Proxy ARP
References
• Andrew S. Tanenbaum, Nick Feamster, and David J. Wetherall;
Computer Networks; Pearson Education; 6th Edition, 2021.

Computer Networks
27
Dr. Divya Lohani

You might also like