You are on page 1of 52

Data communication and computer

networks
Network layer

Sosina M.
Addis Ababa institute of technology
Data communication & computer networks 2012 E.C.
Network layer protocols

Address mapping
Maps a logical address to its corresponding physical address and vice versa
Static mapping
 Creation of a table that associates a logical address with a physical address
Dynamic mapping
 A machine that knows one of the two addresses, can use a protocol to find the other one

Data communication & computer networks 2


Address resolution protocol (ARP)

IP datagram must be encapsulated in a frame


The sender needs the physical address of the receiver
The host/router sends an ARP query
 The packet includes the physical and IP addresses of the sender + the IP address of the receiver
 Every host/router receivers and process the ARP query
The intended recipient sends back an ARP reply
 Recipient IP + physical address

Data communication & computer networks 3


Address resolution protocol (ARP)

Cache memory
ARP rely is stored in the cache memory (for about 20 to 30 minutes)
Before sending ARP request, the system first checks it cache
Packet format

Data communication & computer networks 4


ARP: Operation

The sender know the IP address of the target


Create an ARP request
The sender physical and IP addresses, the target IP address
The target hardware address field is filled with 0s
The message is encapsulated in a frame
Physical address of the sender + the physical broadcast address as the destination
address
Every host/ router receives the frame
The target machine replies with an ARP reply (unicast)

Data communication & computer networks 5


ARP: Different cases

Different cases in which ARP service can be required


A host wants to send a packet to another host on the same network
 The logical address that must be mapped to the physical address →the destination IP address of
the datagram
A host wants to send a packet to another host on another network
 The logical address that must be mapped to the physical address → the IP address of the router
A routers that has received a datagram destined for a host on another network
 The logical address that must be mapped to the physical address →the IP address of the next
router
A router that has received a datagram destined for a host on the same network
 The logical address that must be mapped to the physical address →the destination IP address of
the datagram

Data communication & computer networks 6


ARP: Different cases

Data communication & computer networks 7


Proxy ARP

A proxy ARP is an ARP that acts on behalf of a set of hosts


Whenever a router running a proxy ARP receives an ARP request to one of
these hosts
Sends an ARP reply announcing its own hardware address

A subnet is created without changing the whole system to recognize subnetted


addresses

Data communication & computer networks 8


Reverse address resolution protocol (RARP)

Finds the logical address for a machine that knows only its physical address
A RARP request is created and broadcasted on the local network
A machine on the local network that knows all the IP addresses will respond with a
RARP reply
 The requesting machine must be running a RARP client program
 The responding machine must be running a RARP server program

Data communication & computer networks 9


Bootstrap Protocol (BOOTP)

BOOTP
A client/server protocol designed to provide physical address to logical address
mapping
An application layer protocol
A client uses all 0s as the source address and all 1s as the destination
address
But, a broadcast IP datagram cannot passes through any router
One of the host can be used as a relay agent
The relay agent knows the address of a BOOTP server
Encapsulates the message in a unicast datagram and sends the request to the BOOTP
server
The relay agent, after receiving the reply, sends it to the BOOTP client
Data communication & computer networks 10
BOOTP

Data communication & computer networks 11


Dynamic host configuration protocol (DHCP)

BOOTP is not a dynamic configuration


Contains a table that matches the physical address of the client with its IP address
The binding is predetermined => static configuration
What if the host moves from one network to another?

DHCP provides static and dynamic address allocation that can be manual
or automatic
Static address allocation (manual configuration)
 DHCP acts as BOOTP does
Dynamic address allocation (dynamic configuration)
 Pool of available IP addresses
 When a DHCP client requests a temporary IP address, the DHCP assigns one the available
addresses in the pool for a negotiable period of time

Data communication & computer networks 12


Internet control message protocol (ICMP)

IP protocol is a best-delivery service


No error-reporting or error correcting mechanisms
What happens if a router must discard a datagram because if cannot find a route to
the final destination or the TTL has a zero value?
ICMP is designed to compensate the deficiencies of IP

Types of ICMP messages


Error-reporting
Query

Data communication & computer networks 13


ICMP message
Type of the The reason for the
message particular message
Message format

Error reporting
ICMP reports error ( doesn’t correct error)
Error messages are always sent to the original source
Error types

Data communication & computer networks 14


ICMP error messages

Destination unreachable
Error => A router cannot route a datagram or a host cannot deliver a datagram
Source quench
Error => a datagram is discarded due to congestion
Warns the source that there is a congestion somewhere in the path and that the source should
slow down the sending process
Time exceeded
Error=>TTL value reaches zero or not all fragments that make up a message arrive at the
destination host within a certain time limit
Parameter problem
Error=> ambiguous or missing value in any field of the datagram
Redirection
Redirection message to the sending host

Data communication & computer networks 15


ICMP: redirection

Data communication & computer networks 16


ICMP error messages

No ICMP error message will be generated in response to a datagram


carrying an ICMP error message
No ICMP error message will be generated for a fragmented datagram that
is not the first fragment
No ICMP error message will be generated for a datagram having a
multicast address
No ICMP error message will be generated for a datagram having a special
address such as 127.0.0.0 or 0.0.0.0.

Data communication & computer networks 17


ICMP query

ICMP can diagnose some network problem

Echo request and reply


 To determine whether two system can communicate each other
Timestamp request and reply
 To determine the round trip time (can be used to synchronize the clocks in two machines)
Address-mask request and reply
 To request the address mask (unicast or broadcast)
Route solicitation and advertisement
 A host sends a router-solicitation message to know the address of a connected router
 A router sends a periodic route advertisement or response to solicitation message

Data communication & computer networks 18


Debugging tools

Ping
The source host sends ICMP each request messages
The destination responds with ICMP echo-reply message

Data communication & computer networks 19


Traceroute

Used to trace the route of packet from the source to the destination

How to find route from A to B


UDP message encapsulate in an IP packet with a TTL=1
 R1 sends a time-exceeded ICMP message
UDP message encapsulate in an IP packet with a TTL=2
 R2 sends a time-exceeded ICMP message
UDP message encapsulate in an IP packet with a TTL=3
 The message reached the destination
 The destination port of the UDP packet is set to one that is not supported by the UDP prtotocl
 B discard the message and sends an ICMP destination unreachable message
Data communication & computer networks 20
Internet group management protocol (IGMP)

IGMP – a protocol that manages multicast group membership


IGMP operation

For each group there is one router that has the duty of distributing the multicast
packets destined for that group
A host or multicast router can have membership in a group

Data communication & computer networks 21


ICMPv6
Network layer in v4 and v6

ARP and IGMP are combined in ICMPv6


RARP is dropped
Error reporting and query messages

Data communication & computer networks 22


Network layer: Delivery, forwarding, Routing

Data communication & computer networks 23


Delivery

The handling of packets by the underlying physical network – Delivery


Direct delivery
The destination host and the deliverer are connected to the same physical network
Indirect delivery
The destination host is not on the same network as the deliverer

Data communication & computer networks 24


Forwarding

Forwarding – to place the packet in its route to its destination


Routing table is required

Forwarding techniques – based on the content of the routing table


Next-hop method versus route method

Data communication & computer networks 25


Forwarding techniques

Network specific method vs. host specific

Data communication & computer networks 26


Forwarding techniques

Default method

Data communication & computer networks 27


Forwarding process
A simple forwarding module
We need at least four columns in a routing table

Data communication & computer networks 28


Example

Build a routing table for router R1

Show the forwarding process if a packet arrives at R1 with the destination


address 180.70.65.140
Data communication & computer networks 29
Address aggregation

Data communication & computer networks 30


Longest mask matching

The routing table is sorted from longest mask to the shortest mask

 a packet arrives for organization 4 with destination address 140.24.7.200?

Data communication & computer networks 31


Routing table

Static routing table


Manual entries
Dynamic routing table
Is update periodically by using routing protocols

Data communication & computer networks 32


Routing protocols

A routing protocol is a combination of rules and procedures that let router


in the internet inform each other of changes
When forwarding a packet, the decision is based on optimization
Which of the available pathways is the optimum pathway
Intra and inter domain routing

Data communication & computer networks 33


Routing protocols

Data communication & computer networks 34


Distance vector routing

The least-cost route between any two nodes is the route with minimum
distance
Each node maintains a vector of minimum distance to every node
Each node shares it routing table with its immediate neighbors periodically and when
there is a change

Data communication & computer networks 35


Distance vector routing

Initialization

Updating

Data communication & computer networks 36


Sharing routing table

A node sends its partial routing table (only two columns)


Periodically – normally every 30s
Triggered update
 A node receives a table from a neighbor, resulting in changes in its own table after updating
 A node detects some failure in the neighboring link which results in a distance change to infinity

Data communication & computer networks 37


Two node loop instability

Solutions
Defining infinity – to redefine infinity to a smaller number
 Most implementation define Infinity=16
 Implies - the distance vector routing cannot be used in large system
Split horizon
 Each node sends only part of its table through each interface
 If the optimum path to x is through A, the node doesn’t advertise this piece of information to A
Split horizon and poison reverse
 DV- if there is no news about a route within a giver time, the node deletes the route
 Node B can still advertise the value for X, but if the source of information is A, it can replace the
distance with infinity

Data communication & computer networks 38


Three node instability

When the instability is between three nodes, split horizon and poison
reverse cannot guarantee stability
The loop stops when the cost in each node reaches infinity

Data communication & computer networks 39


Routing information protocol (RIP)

Intra-domain routing protocol


Applies the principle of distance vector routing
Distance=hop count, infinity=16

Data communication & computer networks 40


Link state routing

Each node has the entire topology of the domain, the list of nodes and link,
how they are connected (type, cost, condition of the link (up or down)
Employs Dijkstra's algorithm
The whole topology is established from partial knowledge of each node

Data communication & computer networks 41


Building routing tables

Four set of actions


Creation of the states of links by each node- link state packet (LSP)
Dissemination of LSP to every other router
Formation of a shortest path tree for each node
Calculation of a routing table based on the shortest path tree

Data communication & computer networks 42


Link state packet

Contains
Node identity
List of links
Sequence number
 To distinguished new LSP from old ones
Age
 Prevents old LSPs from remaining in the domain for a long time
Generated
When there is a change in the topology of the domain
On a periodic basis

Data communication & computer networks 43


Flooding of LSPs

The creating node sends a copy of the LSP out of each interface
A node that receives an LSP compares it with the copy it may already have
If older than the one it has – discards the LSP
Otherwise, sends a copy of it out of each interface except the one from which the
packet arrived

Data communication & computer networks 44


Formation of shortest path tree

Start with root node


All other nodes can be reached from the root through only one single route
A shortest path tree – the distance between the root and every other node is the
shortest
Dijkstra algorithm

Data communication & computer networks 45


Example

Data communication & computer networks 46


Open shortest path first (OSPF)

Intra-domain routing based on link state routing


OSPF divides the autonomous system into areas to handle routing
efficiently and in timely manner
The routing information is flooded in the area
At the border of an area special routers summarize the information and sent it to
other areas

Data communication & computer networks 47


Path vector routing

Distance vector routing


Intra-domain
Subjected to instability if there are more than a few hops in the domain of operation
Link state routing
Intra-domain
needs a huge amount of resources to calculate routing tables
creates heavy traffic because of flooding
Path vector
Inter-domain routing
Applies the principle of distance vector routing

Data communication & computer networks 48


Path vector routing

There is one node (can be more than one) in each AS that acts on behalf of
the entire AS
Let us call it the speaker node
The speaker node in an AS creates a routing table and advertises it to
speaker nodes in the neighboring Ass
speaker node advertises the path, not the metric of the nodes

Data communication & computer networks 49


Initial routing tables and updating

Updating
When a speaker node receives a two-column table from a neighbor, it updates its
own table

Data communication & computer networks 50


Loop prevention

The instability of distance vector routing and the creation of loops can be
avoided in path vector routing
When a router receives a message, it checks to see if its AS is in the path list to the
destination.
If it is, looping is involved and the message is ignored
Policy routing
When a router receives a message, it can check the path
If one of the autonomous systems listed in the path is against its policy, it can ignore
that path and that destination
Optimum path
The optimum path is the path that fits the organization

Data communication & computer networks 51


Border Gateway Protocol (BGP)

Inter-domain routing protocol using path vector routing

Data communication & computer networks 52

You might also like