Você está na página 1de 45

Chapter 5

The Network Layer

Network Layer Design Isues

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

Store-and-Forward Packet Switching

fig 5-1

The environment of the network layer protocols.

Implementation of Connectionless Service

Routing within a diagram subnet.

Implementation of Connection-Oriented Service

H1 has established connection 1 with H2; 1,1,1,1,1,1


H3 wants to establish a connection with H2;1(no other connection),2,2,2,2,2

Comparison of Virtual-Circuit and


Datagram Subnets

5-4

Routing Algorithms

The Optimality Principle


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

Routing Algorithms (2)

Conflict between fairness and optimality: To maximize the total


flow, X and X should be shut off altogether. However, fairness is a
problem. Compromise is needed;
**Static routing v.s. adaptive(dynamic) routing;

The Optimality Principle:


If router J is on the optimal path from I to router K, then the optimal path from
J to K also falls along the same route.

(a) A subnet. (b) A sink tree for router B.

Shortest Path Routing

The first 5 steps used in computing the shortest path from A to D.


The arrows indicate the working node.

Dijkstra's algorithm to compute the shortest


path

5-8 top

5-8
bottom

Distance Vector Routing


(exchange small # of large msg)

(a) A subnet. (b) Input from A, I, H, K, and the new


routing table for J.

DV reacts rapidly to good news but


leisurely to bad news: count-to-infinity

(a)(1) A is down initially and all the other routers have the delay to A
as infinity; (2) When A comes up, assuming that there is a gigantic
gong, all routers exchange simultaneously. See the figure (a);
(b) (1) All routers are initially up. B, C, D and E have the delay to A
of 1,2,3 and 4. (2) Suddenly, A goes down. See the figure (b);

Link State Routing (exchange large # of


small msg)
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.

Learning about the Neighbors

(a) Nine routers and a LAN. (b) A graph model of (a).

Measuring Line Cost

(1) Suppose that most of traffic is using CF; (2) EI is more attractive
for shortest path; (3) EI has most of traffic; (4) CF is now more
attractive; routing tables may oscillate wildly; not consider load,
just BW or load balancing

Building Link State Packets

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

Distributing the Link State Packets

The packet buffer for router B in the previous slide (Fig. 5-13).
B has three lines A,C,F;
Send flags: pkt must be forwarded on the indicated line;
ACK flags; B must send ACK to the line;
E arrives twice, once via EAB and once via EFB; D is similar to E;

Hierarchical Routing

Hierarchical routing.

Broadcast Routing

Reverse path forwarding: When a broadcast pkt arrives at a router,


the router checks to see if the pkt arrived on the line that is
normally used for sending pkts to the source of the broadcast. If
so, the router forwards copies of it onto all the other lines; (a) A
subnet. (b) a Sink tree (normally used). (c) The tree built by
reverse path forwarding: (1) F,H,J,N circle; (2) eight pkts are
generated, two by each of the four routers, A,D,G,O,M circle
(3) Six pkts are generated; E, C, K circle (4)

Multicast Routing

(a) A network. (b) A spanning tree for the leftmost router.


(c) A multicast tree for group 1. (d) A multicast tree for group 2.
Scalable, Core-based trees

Routing for Mobile Hosts

A WAN to which LANs, MANs, and wireless cells are attached.

Routing for Mobile Hosts (2)

Packet routing for mobile users.

Routing in Ad Hoc Networks


Possibilities when the routers are mobile:
1. Military vehicles on battlefield.
No infrastructure.
2. A fleet of ships at sea.

All moving all the time

3. Emergency works at earthquake .

The infrastructure destroyed.

4. A gathering of people with notebook computers.

In an area lacking 802.11.

Route Discovery

a) (a) Range of A's broadcast.


b) (b) After B and D have received A's broadcast.
c) (c) After C, F, and G have received A's broadcast.
d) (d) After E, H, and I have received A's broadcast.
Shaded nodes are new recipients. Arrows show possible reverse routes.

Route Discovery (2)

Format of a ROUTE REQUEST packet.


1. Source address and Request ID uniquely identify the RREQ pkt;
2. Source and Dest. seq#: like a clock to tell new routes from old
routes;
3. Hop count: keep track of how many hops the pkt has made; initially
0;

Route Discovery (3): When an RREQ


arrives at a node
1.

2.

3.

(Source address, Req ID) is looked up in a local history table to see


if this request has already been processed; If duplicate, it is
discarded; If not, the pair is entered into the history table for future
duplicate check;
The receive looks up the dest in its routing table. If a fresh route
exists, an RREP is sent back; Fresh ? Dest. Seq# stored >= that
in the RREQ pkt; If not fresh, perform step 3;
Increment the Hop count field and rebroadcasts the RREQ pkt;
Extract the data from the pkt and store it as a new entry in its
reverse route table. The info is used to construct the reverse route so
that the reply can get back to the source.

Route Discovery (4)

Format of a ROUTE REPLY packet.


Dest. Seq#: taken from the counter of Dest. in memory;
Hop count: set to 0 by Dest; incremented by the intermediate node;
Lifetime: how long the route is valid;
This pkt is unicast to the node that the RREQ pkt came from;

Route Maintenance

(a) D's routing table before G goes down. (b) The graph after G has gone
down.
Each node broadcasts Hello msg periodically; If no response, the route may
have problem.
For each possible dest., each node keeps track of its neighbors that have fed
it a pkt for that dest. during the last observing period active neighbors for
that dest.
If G is down, D finds E,G,I the union of active neighbors for E,G,I is
{A,B}. D purges the entries of E,G,I from the routing table and tells A and B

Structured P2P: Chord


a)
b)
c)
d)

e)
f)

g)

h)

i)

j)

k)

SHA-1: a hash function to produce a highly-random 160-bit number;


SHA-1(any IP address) a 160-bit number (node identifier)
Conceptually, all the 2160 node identifiers are arranged in
ascending order in a big circle. However, not all nodes exist.
For the next graph, only 1,4,7,12,15,20 and 27 actual nodes;
successor(k): the node identifier of the first actual node following k
around the circle clockwise, e.g., successor(6)=7, successor(8)=12,
successor(22)=27;
The names of the records (song names) are also hashed to generate
a 160-bit number (called key); key=hash(name);
If a person want to let a record for name of his to be available, he
builds a tuple consisting of (name, my-IP-address) and then ask
successor(hash(name)) to store the tuple;

If some user wants to look up name, he hashes it to get key (this step
is easy) and then uses successor(key) to find the IP address of the
node storing its index tuples (the second step is not easy).
To do this, each not must maintain certain administrative data
structures. One of these is the IP address of its successor node, e.g.,
in the next graph, node 4s successor is 7, node 7s successor is 12;
Lookup requesting node sends a pkt to its successor containing
its IP address and the key it is looking for go on and on; may use
bi-direction search, however, still need avg. n/2 per search;
finger table is proposed;
Finger table has m entries, indexed by 0 ~ m 1, each one pointing
to a different actual node. Each entry has two fields: start and the IP
address of successor(start); For entry i at node k
start[i] = k + 2i(modulo 2m); IP address of succesor(start[i])
avg. # of lookups = log2n

Ex. 1, looking key=3 at node 1 3 lies betw it and its successor, 4


found, returning node 4s IP address;
m) Ex. 2, looking key=14 at node 1 the closest predecessor to 14 is 9,
the request is forwarded to the IP address of 9s entry, 12 12
found that 14 lies betw it and its successor 15 found, returning
node 15s IP address;
n) Ex. 3, looking key=16 at node 1 as Ex.2, a query is sent to node
12 the node most closely preceding 16 = 14, which yields IP
address of node 15 a query is sent to node 15 node 15 found
that 16 lies betw it and its successor 20 found, returning node
20s IP address;
o) When a new node, r, wants to join, it must contact some existing
node and ask it took up the IP address of successor(r) for it.The
new node then asks successor(r) for its predecessor. The new
node asks both of these to insert r in betw them; e.g. , r=24 ask
any node successor(24)=27 ask 27, its predecessor=20 27
hands over those keys in the range 21-24 to 24 done however,
many finger tables are now wrong recompute each finger by
l)

p)

q)

When a node leaves gracefully, it hands its keys over to its


successor and informs its predecessor of its departure linking the
predecessor to the successor;
When a node crashes, its predecessor no longer has a valid
successor. each node keeps track s direct successors, to allow it
to skip over up to s-1 consecutive failed nodes and reconnect the
circle;

Node Lookup in Peer-to-Peer Networks

(a) A set of 32 node identifiers arranged in a circle. The shaded ones


correspond to actual machines. The arcs show the fingers from
nodes 1, 4, and 12. The labels on the arcs are the table indices.
(b) Examples of the finger tables.

Congestion Control Algorithms

General Principles of Congestion Control


Congestion Prevention Policies
Congestion Control in Virtual-Circuit Subnets
Congestion Control in Datagram Subnets
Load Shedding
Jitter Control

Congestion

When too much traffic is offered, congestion sets in and


performance degrades sharply.

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.

Congestion Prevention Policies

5-26

Policies that affect congestion.

Congestion Control in Virtual-Circuit


Subnets

(a) A congested subnet. (b) A redrawn subnet, eliminates


congestion and a virtual circuit from A to B.

Hop-by-Hop
Choke Packets

(a) A choke packet that affects


only the source.
(b) A choke packet that affects
each hop it passes through.

Jitter Control

(a) High jitter.

(b) Low jitter.

Quality of Service

Requirements
Techniques for Achieving Good Quality of Service
Integrated Services
Differentiated Services
Label Switching and MPLS

Requirements

5-30

How stringent the quality-of-service requirements are.

Buffering

Smoothing the output stream by buffering packets. (playback buffering)

The Leaky Bucket Algorithm

(a) A leaky bucket with water. (b) a leaky bucket with packets.

The Token Bucket Algorithm

5-34

(a) Before.

(a) Input to a leaky bucket.


(b) Output from a leaky
bucket (capacity>=1MB).
Output from a token bucket
with capacities of (c) 250
KB, (d) 500 KB, (e) 750
KB, (f) Output from a
500KB token bucket feeding
a 10-MB/sec leaky bucket.
(c) 250KB+2MB*11ms ~
25MB*11ms; note: token
bucket cap. C bytes, token
arrival rate bytes/sec,
maximum output rate M
bytes/sec, burst length S
sec C+S = MS;

(b) After.

Admission Control

5-34

An example of flow specification.

Packet Scheduling: byte-by-byte round


robin

(a) A router with five packets with length 2 ~6 bytes queued


for line O.
(b) Finishing times for the five packets.

RSVP-The ReSerVation Protocol

(a) A network, (b) The multicast spanning tree for host 1.


(c) The multicast spanning tree for host 2.

RSVP-The ReSerVation Protocol (2)

(a) Host 3 requests a channel to host 1. (b) Host 3 then requests a


second channel, to host 2. (c) Host 5 requests a channel to host 1.

Expedited Forwarding

Expedited packets experience a traffic-free network.

Assured Forwarding

A possible implementation of the data flow for assured forwarding.

Label Switching and MPLS

Transmitting a TCP segment using IP, MPLS, and PPP.

Internetworking

How Networks Differ


How Networks Can Be Connected
Concatenated Virtual Circuits
Connectionless Internetworking
Tunneling
Internetwork Routing
Fragmentation

Connecting Networks

A collection of interconnected networks.

How Networks Differ

5-43

Some of the many ways networks can differ.

How Networks Can Be Connected

(a) Two Ethernets connected by a switch.


(b) Two Ethernets connected by routers.

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.

Internetwork Routing

(a) An internetwork. (b) A graph of the internetwork.

Fragmentation

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

Fragmentation (2)

Fragmentation when the elementary data size is 1 byte.


(a) Original packet, containing 10 data bytes.
(b) Fragments after passing through a network with maximum
packet size of 8 payload bytes plus header.
(c) Fragments after passing through a size 5 gateway.

The Network Layer in the Internet

The IP Protocol
IP Addresses
Internet Control Protocols
OSPF The Interior Gateway Routing Protocol
BGP The Exterior Gateway Routing Protocol
Internet Multicasting
Mobile IP
IPv6

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: replacing a module is easier.
Expect heterogeneity: different type of hardware,
transmission facilities, and applications must work.
Avoid static options and parameters:negotiability.
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.

IP Addresses (2)

Special IP addresses.

Subnets

A campus network consisting of LANs for various departments.

Subnets (2)

A class B network subnetted into 64 subnets.

CDR Classless InterDomain Routing

5-59

A set of IP address assignments.

NAT Network Address Translation

Placement and operation of a NAT box.

Internet Control Message Protocol

5-61

The principal ICMP message types.

ARP The Address Resolution Protocol

Three interconnected /24 networks: two Ethernets and an FDDI ring.


Proxy ARP: CS router replies the request for 192.31.63.8 (station 4)

Dynamic Host Configuration Protocol

Operation of DHCP.

OSPF The Interior Gateway Routing


Protocol

(a) An autonomous system. (b)

A graph representation of (a).

OSPF (2)

The relation between ASes, backbones, and areas in OSPF.

OSPF (3)

5-66

The five types of OSPF messeges.

BGP The Exterior Gateway Routing


Protocol

(a) A set of BGP routers.

(b) Information sent to F.

The Main IPv6 Header

The IPv6 fixed header (required).

IPv6 Header
a)
b)
c)
d)
e)

f)
g)
h)

Version: 6 for IPv6;


Traffic class: different real-time delivery requirements; for
multimedia delivery;
Flow label: allow source and destination to set up a
pseudoconnection;
Payload: how many bytes follow the 40-byte header;
Next header: tells which of the six extension headers, if any, follow
this one; if the last IP header, the Next header tells which transport
protocol handler to pass the packet to;
Hop limit: the same as TTL in IPv4;
No IHL since the header length is fixed;
No Checksum;

Extension Headers

5-69

IPv6 extension headers. (Only the source can fragment a packet)

Extension Headers (2)

The hop-by-hop extension header for large datagrams (jumbograms);


Payload length =0;
Code 194;
4-byte number;

Extension Headers (3)

The extension header for routing.


Like IPv4 loose source routing;
Routing type: format of the rest of the header;
Segments left: how many of the addresses in the list have not yet
been visited;

Homeworks
a)

15, 16, 27, 35, 37, 38, 40, 41, 43, 51,

Você também pode gostar