Professional Documents
Culture Documents
Router Router
TCP
TCP
IP
IP IP IP
LLC
LLC LLC LLC
MAC MAC
MAC MAC
PHY
PHY PHY PHY PHY PHY
Network layer : Introduction
class
1.0.0.0 to
A 0 network host 127.255.255.255
B network 128.0.0.0 to
10 host
191.255.255.255
192.0.0.0 to
C 110 network host
239.255.255.255
240.0.0.0 to
D 1110 multicast address
247.255.255.255
32 bits
IP Addressing (3)
(address, mask_size)
• Known as Classless Inter-Domain Routing (CIDR)
Classless Inter-Domain Routing
• Uses slash notation
• Example
128.211.0.0/17
Means that the boundary between prefix and suffix occurs after the first
17 bits
• Each network can be as large or small as needed (power of two)
IP addressing: example (1)
223.1.1.1
223.1.2.1
223.1.1.2
223.1.1.4 223.1.2.9
223.1.2.2
223.1.1.3 223.1.3.27
LAN
223.1.3.1 223.1.3.2
IP addressing: example (2)
223.1.1.2
223.1.1.1 223.1.1.4
223.1.1.3
223.1.9.2 223.1.7.0
223.1.9.1 223.1.7.1
223.1.8.1 223.1.8.0
223.1.2.6 223.1.3.27
Link layer
physical layer
Forwarding: Getting a datagram from source to
destination (1)
routing table in A
Dest. Net. next router Nhops
223.1.1 1
223.1.2 223.1.1.4 2
IP datagram: 223.1.3 223.1.1.4 2
misc source dest A
data 223.1.1.1
fields IP addr IP addr
223.1.2.1
• datagram remains 223.1.1.2
223.1.1.4 223.1.2.9
unchanged, as it
B
travels source to 223.1.2.2
223.1.1.3 223.1.3.27 E
destination
223.1.3.2
• address fields of 223.1.3.1
interest here
Forwarding: Getting a datagram from source to
destination (2)
misc
data
fields 223.1.1.1 223.1.1.3 Dest. Net. next router Nhops
223.1.1 1
Starting at A, given IP 223.1.2 223.1.1.4 2
datagram addressed to 223.1.3 223.1.1.4 2
B: A 223.1.1.1
• look up net. address of B 223.1.2.1
223.1.1.2
• find B is on same net. as A
223.1.1.4 223.1.2.9
• link layer will send B
223.1.2.2
datagram directly to B 223.1.1.3 223.1.3.27 E
inside link-layer frame
223.1.3.1 223.1.3.2
B and A are directly
connected
Forwarding: Getting a datagram from source to
destination (3)
• Two classes
Non-adaptive routing algorithms : independent of current
situation = static routing algorithms
Adaptive algorithms : based on current network state
(topology, traffic situation)
• centralized : global information collected and used to
take routing decisions
• isolated : each host takes decisions based on locally
available information (e.g. length of buffers)
• distributed : mixture of local and global information are
used to take routing decisions
Routing: Shortest Path Algorithm
2 3
2 3
A E 2 F D
6 1 2 2
4
G H
Multipath Routing
• Multipath routing
several candidates to be used as path
may improve reliability
• first path : shortest path
• second path : shortest path disjunct with first path
improves load balancing
• circuit switching
• packet switching
Multipath Routing : Example
A B C D
E F G H
I J K L
Centralized Routing
• Routing Control Center :
RCC receives information from nodes
RCC computes routes leading to routing tables
RCC distributes periodically routing tables
• Advantages
RCC uses global information to compute routes
hardware/software only in RCC
• Disadvantages
reliability : if RCC fails, network fails
inconsistencies due to long distances
overhead due to routing messages
Isolated Routing
• Hot-Potato Algorithm
route packet to line with shortest queue
combine with other routing strategies
• Backward Learning Algorithm
packet contains number of hops
use this information to determine routes
Flooding
1
B C cost to destination via
7 E
A 8 2 D () A B D
1
E D A 1 14 5
2
E D B 7 8 5
destination
D (C,D) = c(E,D) + minw {D (C,w)}
= 2+2 = 4
E D
C 6 9 4
D (A,D) = c(E,D) + minw {D (A,w)}
= 2+3 = 5 loop! D 4 11 2
E B
D (A,B) = c(E,B) + minw{D (A,w)}
= 8+6 = 14 loop!
Distance table gives routing table
A 1 14 5 A A,1
B 7 8 5 B D,5
destination
destination
C 6 9 4 C D,4
D 4 11 2 D D,2
C.b
B.a
A.a Host
b A.c c h2
a C a
b
a B
Host d
h1 c
A b
Datagram in IPv4
version H length Type of Service
Total length
Identification
D M Fragment offset
Time to live Protocol
Header checksum
Source IP address
Destination IP address
Options
Destination Address
IPv6 Header Fields
• Version (4bits) : 6
• Traffic Class (8 bits)
different priority classes
• Flow Label (20 bits)
label for sequences of packets which require a
certain QoS
• Payload Length (16 bit)
Length of the IPv6 payload
Extension headers are considered as payload
IPv6 Header Fields
• Intranet fragmentation
SAR performed on a per network basis
• Internet fragmentation
Fragmentation performed if required
No reassembly per network
• IP uses Internet fragmentation
Routing in the Internet (1)
Inter-AS
C.b routing
between B.a
A.a A and B Host
b A.c c h2
a C a
b
a B
Host d c Intra-AS routing
h1 b
A within AS B
Intra-AS routing
within AS A
Internet Control Message Protocol
• ICMP
Used by hosts and gateways for network
management purposes
Functions :
• Error reporting
• Reachability testing
• Congestion control
• Route exchange
• Performance measuring
• Submit addressing