20101 the network layer chapter 5. 20102 network layer task getting packets from the source all the...

30
2010 1 The Network Layer Chapter 5

Post on 22-Dec-2015

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 1

The Network Layer

Chapter 5

Page 2: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 2

Network Layer Task•getting packets from the source all the way to the destination•may require many hops through intermediate routers.

•This contrasts with the data link layer, which just moves frames from one end of a wire to another.

•it must know about the topology of the communication subnet ( the set of all routers) and choose appropriate paths through it.•It must take care to choose routers to avoid overloading some of the lines and routers while leaving others idle.•When source and destination are in different networks, it has to deal with the differences.

Page 3: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 3

Services to transport layerGoals:

1.The services should be independent of the router technology2.The transport layer should be shielded from the number, type and topology of the subnets present.3.The network addresses made available to the transport layer should use a uniform numbering plan across LAN’s and WAN’s

The Internet community argues that a subnet is inherently unreliable, the hosts should do error control and flow control. The service should thus be connectionless, but as reliable as possible, and most of the complexity is placed on the hosts.

The telephone companies argue that the subnet should provide a reliable, connection-oriented service, placing the complexity in their subnets.

Page 4: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 4

Implementation of Connectionless Service

Page 5: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 5

Implementation of Connection-Oriented Service

A route from source to destination is chosen as part of the connection setup. Such a route is called a virtual circuit (VC). Each router along the path puts an entry in a table, linking a VC to an outgoing line.

Page 6: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 6

Comparison of Virtual-Circuit and Datagram Subnets

Page 7: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 7

FloodingA simple static algorithm is flooding, in which every incoming packet is sent out on every outgoing line except the one it arrived on.

It generates a vast number of duplicate packets, an infinite number unless some measures are taken to damp the process. E.g. a hop counter in the header of each packet, which is decremented at each hop, and the packet is discarded when the counter reaches 0.

In selective flooding the packets are only sent out on those lines that are going approximately in the right direction.

Flooding might be usable in military applications, large numbers of routers may be blown to pieces at any instant, as it is very robust.

Also during initialization of routers.

Page 8: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 8

Shortest Path Routing

Dijkstra's (or another) algorithm is used to compute the path with the shortest length between any two nodes.

In general the labels on the arcs can be computed as a function of distance, bandwidth, average traffic, communication costs, mean queue length, measured delay, etc.

•Subnet as an undirected graph•node: a router•arc: a communication link•labeled with a length.

Page 9: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 9

Distance Vector RoutingA routing table in each router contains for each router the preferred outgoing line for that router and an estimate for the “cost” to that destination.

The cost metric might be number of hops, queue length, time delay, etc. Time delay is measured by periodically sending ECHO packets.

Once every T msec each router sends to its neighbors a list of estimated “costs” to each destination.

Page 10: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 10

Link State RoutingDistance vector routing reacts slowly on bad news, e.g. break down

of a link (count to infinity problem). The core of the problem is that when X tells Y that it has a path somewhere, Y has no way of knowing whether it itself is on the path.

Link State Routing: each router sends costs to neighbors to all other routers.

Each router must:

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.

Page 11: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 11

Link State Packets

The trickiest part is distributing the link state packages reliably, to assure that each router has basically the same view of the subnet.

A 32 bit sequence number (sufficient for 137 years, if it is updated every second) is used.

An age field is decremented every second and at every send and the packet is discarded if the age reaches 0.

All link state packets are acknowledged.

Page 12: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 12

Hierarchical Routing

Page 13: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 13

Congestion

The reason congestion and flow control are often confused is that some congestion control algorithm operate by sending messages back to various sources, telling them to "slow down". Thus a host can get a "slow down" message either because the receiver on the direct link cannot handle the load or because the network cannot handle it.

When too many packets are present, buffers get full, packets are discarded, more retransmissions and less packets delivered. Congestion thus tends to feed upon itself and become worse, leading to collapse of the system.

Page 14: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 14

Quality of Service Requirements

Page 15: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 15

Jitter Control

For applications such as audio and video streaming, it does not matter much if the packets take 20 or 30 msec to be delivered, as long as the transit time is constant. The jitter should be small.

In some applications, like video on demand, jitter can be compensated for by buffering at the receiver. For others, like Internet telephony or videoconferencing, the delay inherent in buffering is not acceptable.

Page 16: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 16

Quality of Service1. Constant bit rate (e.g. telephony), attempts to simulate a wire,

providing uniform bandwidth and delay.2. Variable bit rate (e.g. compressed videoconferencing), images must

arrive in time independent on how much they could be compressed. 3. Non-real-time variable bit rate (e.g. watching a movie over

internet), a lot of buffering at the receiver is allowed.4. Available bit rate (e.g. file transfer), not sensitive to jitter or delay.

Not present in original Internet, becomes more and more important.More or less provided by “sufficient bandwidth”

Page 17: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 17

Fragmentation

Transparent and non-transparent fragmentation.

Page 18: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 18

The IPv4 Protocol

The IHL field tells how long the header is, in 32 bit words.The Type of Service field contains a 3 bit Precedence field, used for the priority from 0 (normal) to 7 (network control packet), and 3 flags Delay, Throughput and Reliability, to specify what is most important for the packet. In practice, current routers mostly ignore the TOS field. The situation is changing.

Page 19: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 19

Some options for IPv4The Time to Live field is a counter to limit packet lifetimes, it must be decremented at each hop. The packet is discarded when TOL hits 0.The Protocol field tells the receiving host which transport process (TCP, UDP or other) the packet should be given to.The Header checksum verifies the header only, useful for detecting errors by bad memory bytes or corrupted software inside a router. It must be recomputed at each hop, because the TTL changes.

Page 20: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 20

IP Addresses

The class A, B resp. C formats allow for 126, 16382 resp. 2 million networks with 16 million, 64K resp. 254 hosts.Network addresses were given to organizations, leading to many unused host numbers.

Page 21: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 21

Special IP Addresses

IP addresses of the form 10.x.y.z (and other one) are intended for use within a LAN (company or home nowadays). They are not intended to go on the public internet.

Page 22: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 22

CIDR – Classless InterDomain Routing

Class A and B networks were given out, Class C were too small.A basic idea is to allocate the remaining class C networks (more than 2 million, and later A and B) in variable sized blocks of 254 addresses, a site needing 8000 addresses then gets 32 contiguous class C networks.The world was divided up into 4 zones to easy hierarchical routing. A site outside Europe, that gets a packet destinated for 194... or 195... can just send it to its standard European gateway.

Page 23: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 23

NAT – Network Address Translation

NAT makes the IP network in fact connection-oriented as it maintains information on each connection passing through it. A crash of the NAT box terminates every TCP connection.Some protocols send IP numbers (and port numbers) in data, to be used by the other side. They have been adapted or other ways are used.

Dirty trick!

Page 24: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 24

Internet Control Message Protocol

When something unexpected occurs in a router or host, this event is reported by ICMP. The most important messages are in the table.

It is also used by routers to test the internet or to obtain information to be use in routing decisions.

Each ICMP message is encapsulated in an IP packet.

Page 25: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 25

ARP– The Address Resolution Protocol

IP addresses must be linked to data link layer addresses, like Ethernet addresses or other types.With ARP the host broadcast a frame asking who owns a certain IP address, like E1 asking for 192.31.65.5. Host E2 alone will answer with a broadcast frame telling its IP and ethernet number.Entries in the ARP cache time out to allow for hardware changes.

Page 26: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 26

Dynamic Host Configuration Protocol

If a computer boots ups, what is it IP address?It could be a fixed number, which is in the computer. But this requires administrative procedures, which cost time and are error prone.DHCP (Dynamic Host Configuration Protocol) assigns IP addresses dynamically.Older protocols for this are RARP and BOOTP.

Page 27: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 27

IPv6The major goals of the new IPv6 protocol were:

• Support billions of hosts, even with inefficient address space allocation

• Reduce the size of the routing tables

• Simplify the protocol, to allow routers to process packets faster

• Provide better security (authentication and privacy)

• Pay more attention to type of service, particularly for real time data

• Aid multicasting by allowing scopes to be specified

• Make it possible for a host to roam without changing its address

• Allow the protocol to evolve in the future

• Permit the old and the new protocols to coexist for years

Page 28: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 28

The Main IPv6 Header

The flow label is also still experimental but will be used to allow a source and destination to set up a pseudo-connection with particular properties and requirements.

Traffic class, is used to distinguish between packets whose sources can be flow controlled, values between 0 and 7, or not, values between 8 and 15.

Page 29: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 29

Extension HeadersExtension header Description

Hop-by-hop optionsMiscellaneous information for routersSupport for datagrams larger than 64K (jumbograms)

Routing Full or partial route to follow

FragmentationManagement of datagram fragmentsSimilar to IPv4, but only the sending host can fragment a packet

Authentication Verification of the sender's identity

Encrypted payload Information about the encryption

Destination options Additional information for the destination

The use of jumbograms is important for supercomputer applications that must transfer gigabytes efficiently across the Internet.The routing header list up to 24 routers that must be visited on the way to the destination. Both strict (the full path is supplied) and loose (only selected routers are supplied) are available, and they can be combined.

Page 30: 20101 The Network Layer Chapter 5. 20102 Network Layer Task getting packets from the source all the way to the destination may require many hops through

2010 30

AddressesPrefix Usage Fraction

0000 0000 Reserved, including IPv4 1/256

0000 001 OSI NSAP addresses 1/128

0000 010 Novell IPX addresses 1/128

010 Provider-based addresses 1/8

100 Geographic-based addresses 1/8

1111 1110 10 Link local use addresses 1/1024

1111 1110 11 Site local use addresses 1/1024

1111 1111 Multicast 1/256

other unassigned 371/512

In addition to multicast, also anycast is supported. The destination is a group of addresses, but it is tried to deliver the packet to just 1 of them, usually the nearest one. This can be used for example to contact a group of cooperating file servers.

The 16 byte addresses are written as 8 groups of 4 hexadecimal digits with colons between the groups, leading 0's can be left out and 1 or more groups of 16 0's can be replaced by a pair of colons.: 8000::123:4567:89AB:CDEF.