You are on page 1of 49

6.

3 The Network Layer

Source: A.S.Tanenbaum: Computer Networks

Network Layer Design Issues


Store-and-Forward Packet Switching Services Provided to the Transport Layer Implementation of Connectionless Service Implementation of Connection-Oriented Service Comparison of Virtual-Circuit and Datagram Subnets

Packet Size Consideration


End-to-end delay depends largely on packet size Short packets advantageous However: each packet has minimum header - > overhead

Store-and-Forward Packet Switching

fig 5-1

The environment of the network layer protocols.

Requirements
Service independent from router technology Transport layer shielded from number , type technology of routers Network addresses made available to transport layer should use a uniform numbering plan, even across LANs and WANs

Implementation of Connectionless Service

Routing within a diagram subnet.

Implementation of Connection-Oriented Service

Routing within a virtual-circuit subnet.

Comparison of Virtual-Circuit and Datagram Subnets

5-4

Virtual Circuit
Resources reserved in advance (buffers, bandwidth,..) Once packets arrive, the necessary resources are available at the router Vulnerabilty: if a router crashes and loses memory, all VC aborted Datagram service can continue different route Better possibility for traffic balancing

Table Space
Datagram subnet needs an entry for every possible destination Virtual circuit subnet needs an entry for every virtual circuit

Routing
Main function on layer 3 Decision made, which output line an incoming packet will take Datagram: decision every time a packet arrives If VC used: routing decision only when setting up the VC Line may fail, topology changes Routing algorithm copes with changes

Routing Algorithms (2)

Conflict between fairness and optimality.

Routing Algorithms
Adaptive: reflect changes in topology, traffic Non-adaptive: not based on actual status of network, no measurement

The Optimality Principle

It states that if router J is on the optimal path from I to K, then the optimal path from J to K also falls along the same route

Routing Algorithms
Shortest Path Routing Flooding Distance Vector Routing Link State Routing Hierarchical Routing Broadcast Routing Multicast Routing Routing for Mobile Hosts Routing in Ad Hoc Networks

Shortest Path Routing

Flooding
Every incoming packet sent to every outgoing port Many duplicate packets Hop counter: decremented each hop, packet discarded when 0 Only packet with short number of hops survives Wasteful in terms of capacity

Improvement: selective flooding, packet sent only to those ports which are approx. in the right direction

Dynamic Routing
Modern computer networks use dynamic routing Static routing does not take network load into account Distance vetor and link state routing popular

Distance Vector Routing


Router maintains a table indexed by, and containing one entry for each router in the subnet Entry contains: preferred outgoing line for the destination and estimate of time / distance to destination Metric: e.g. no. of hops Tables are updated by exchanging information with neighbours

Distance Vector Routing

J-H: 12 ms, H-G: 6, total J G: 18 ms J-A: 8 ms, A G: 18 ms, total J-G via A: 26 ms J-G via H better: new table entry

Link State Routing


Each router must do the following: 1. Discover its neighbors, learn their network address. 2. Measure the delay or cost to each of its neighbors. 3. Construct a packet telling all it has just learned. 4. Send this packet to all other routers. 5. Compute the shortest path to every other router.

Comparison
DVR used in ARPA, replaced by Link State Routing No link speed was taken into account, initially all the same (56 kbit/s), problem when parts were upgraded to higher bandwidth

Learning about the Neighbors

HELLO packet sent on all point-point links, router on opposite end supposed to reply

Measuring Line Cost

Delay measured with ECHO packet (ping) A subnet in which the East and West parts are connected by two lines.

Building Link State Packets

(a) A subnet. (b) The link state packets for this subnet.

When to build?
a) b) Regularly When something changes significantly in the network (line goes down,)

How to inform the others?


Routers who get link state packets first, will change routes Different routers will see different topologies Leads to inconsistencies Flooding used to istribute link state packets Eaxh packet has sequence no., incremented for each new packet Routers keep track of all source router, sequence no. If new, forwarded to all ports If duplicated discarded If packet with lower seq no. arrives, rejected Problem, if router crashes, it loses track of seq. no. Age counter as solution: decremented every second

Distribution
When age conter is zero, info from this router is discarded

Distributing the Link State Packets

Hierarchical Routing
As networks grow in size, tables get larger More CPU time consumed to scan tables At some point unfeasible Routers are grouped in regions Router knows who to forward packets to all destinations in regions No knowledge about structure in other regions

Hierarchical Routing

Drawback: all packets to 5 have to go via 3, never 2

Hierarchical routing.

General Principles of Congestion Control


1. Monitor the system . detect when and where congestion occurs. 2. Pass information to where action can be taken. 3. Adjust system operation to correct the problem.

Possible Metrics
Percentage of packets discarded Average queue length No of packets timing out Average packet dealy Standard deviation of packet delay Rising numbers indicate congestion

Countermeasures
Transfer information from where detected to possible point of origin This extra information increases load Alternative: set a bit in every packet, when congestion is detected Send probe packets to ask other node (router) whether there congestion If yes, send packets via other routes

Congestion
Load greater than available rsources Solution: increase bandwidth or reduce load A good routing algorithm helps avoiding congestion by spreading traffice over all lines Packet lifetime management: how long a packet my exist in network

Congestion Control in VC Subnets


Admission control: if congestion builds up, no more VC as allowed, until problem disappears Analogy: telephone network

Jitter Control
Packets ahead of schedule slowed down Packets behind schedule accelerated

(a) High jitter.

(b) Low jitter.

Concatenated Virtual Circuits

Internetworking using concatenated virtual circuits.

Connectionless Internetworking

A connectionless internet.

Tunneling

Tunneling a packet from Paris to London.

Tunneling (2)

Tunneling a car from France to England.

Fragmentation

(a) Transparent fragmentation. (b) Nontransparent fragmentation.

The Network Layer in the Internet


The IP Protocol IP Addresses

Design Principles for Internet


1. 2. 3. 4. 5. 6. 7. 8. 9. 10. Make sure it works. Keep it simple. Make clear choices. Exploit modularity. Expect heterogeneity. Avoid static options and parameters. Look for a good design; it need not be perfect. Be strict when sending and tolerant when receiving. Think about scalability. Consider performance and cost.

Collection of Subnetworks

The Internet is an interconnected collection of many networks.

The IP Protocol

The IPv4 (Internet Protocol) header.

The IP Protocol (2)

5-54

Some of the IP options.

IP Addresses

IP address formats.

The Main IPv6 Header

The IPv6 fixed header (required).

You might also like