Lecture 5 Network Layer Part 1
Lecture 5 Network Layer Part 1
Part 1
Services provided by Network Layer
– Routing
• Knowing which is the correct output interface
– Contention
• Buffering of packets (needs queue of storage)
– Heterogeneity
– Scalability
• Lower layers define maximum transfer unit (MTU) for the network layer.
protocols:
– IPv6(RFC 2460)
• Then 1400 bytes will be divided into smaller chunks: 512, 512, 376
The first packet will have the following The second packet will have the The thirst packet will have the following
parameters: following parameters: parameters:
• Id: x • Id: x Id: x
• MF: 1 • MF: 1 MF: 0
• Offset: 0 • Offset: 512 Offset: 1024
• Date: 512 bytes • Date: 512 bytes Date: 376 bytes
• After receiving all the chunks, the receiver will assemble the data and forward it to the
upper layer protocol.
• Receiver gives up reassembly if all data segments do not receive at the receiver.
IPv4 Header (Contd.)
Fragmentation and Reassembly Example
IPv4 Header (Contd.)
• TTL: number of hops after which the network will discard the
packet. Hop count is decremented on each hop (forwarding).
• Protocol: The IP packet is containing data of which upper
layer protocol. (TCP:6) (UDP:17)
• Header Checksum: Used for error detection
• Source Address: 32 bit IP address of source node.
• Destination Address: 32 bit IP address of destination node.
IPv4 Address
• 32 bits long
• Identifier for host, router interface
• Notation:
– Each byte is written in decimal in MSB order,
separated by dots
– Example: 128.195.1.80 stands for the 32-bit IP address
• Address range:
– 0.0.0.0 – 127.255.255.255
D 1110
E 1111
• Reserved Addresses
• No default subnet mask
• Address range:
– 240.0.0.0 – 255.255.255.255
16 8 8
bits id
Network bits id
Subnet bits id
Host
Example 165.230 .24 .8
Address:
Subnet Masks
Whereas
Machine A Machine
B
Application Application
Network Network
1 2
Routing Protocols (contd.)
• Routing algorithms are the part of the Network Layer responsible for deciding on which
output interface /link to transmit an incoming packet.
• Algorithm properties: correctness, simplicity, robustness, stability, fairness, optimality,
and scalability.
• Routing protocols visualize network as graph G (V,E) where V are the nodes of the network
and E are the edges in the network representing links between the two nodes.
• V={v1, v2, v3, …..vn}
• E={(v1,v3),……..}
• Autonomous system (domain): All the networks Routing Table
under a single administrative control. Destination Net Next Hop Cost
Id
172.23.0.0 IF1 25
192.26.25.0 IF7 12
…. … …