The Network Layer Design Issues Routing Algorithms Congestion Control

Download Report

Transcript The Network Layer Design Issues Routing Algorithms Congestion Control

The Network Layer

 Design Issues  Routing Algorithms  Congestion Control  Internetworking  Example Network Layer Protocols Computer Networks - Network Layer 1

Goals of the Network Layer

 The network layer is concerned with getting packets from the source all the way to the destination  the network layer must  know the topology of the communication subnet  choose route to avoid overloading some of the communication lines and routers while leaving others idle  deal with problems when the source and destination are in different networks Computer Networks - Network Layer 2

Services Provided to the Transport Layer

 Connectionless (unreliable) services  each packet must carry the full destination address  no packet ordering and flow control should be done  Connection-oriented (reliable) services  a network layer process on the sending site must set up a connection to its peer on the receiving side  when a connection is set up, two processes can enter a negotiation about service parameters  packets are delivered in sequence  flow control is provided automatically Computer Networks - Network Layer 3

International Organization of the Network Layer

 virtual circuit  a route from the source to the destination is chosen as part of the connection setup  primarily for connection-oriented service  datagrams  each packet sent is routed independently of its predecessors  for connection-oriented and connectionless services Computer Networks - Network Layer 4

Datagram Vs. Virtual Circuit

Issue

Circuit Setup Addressing State information Routing Effect of router failures Congestion control

Datagram

Not needed Each packet contains the full source and destination address Subnet does not hold state information Each packet is routed independently None, except for packets lost during the crash Difficult

Virtual Circuit (VC)

Required Each packet contains a short VC number Each VC requires subnet table space Route chosen when a VC is set up; all packets follow this route All VCs that passed through the failed router are terminated Easy if enough buffers can be allocated in advance for each VC Computer Networks - Network Layer 5

Combinations of Services and Subnet Structures

Services provided by Transport layer Services provided to Transport layer Connection-oriented Connection-oriented Connectionless Connectionless Subnet Structures Virtual Circuit Datagram ATM AAL1 over ATM UDP over ATM IP Computer Networks - Network Layer TCP over IP UDP over IP 6

Routing

 Packets are often routed from the source to the destination hop by hop.

 Two networks are connected by at least a router . The network is defined from the point of view of the network layer.

Computer Networks - Network Layer 7

Types of Routing

 Static Routing  Routes to destinations are predetermined and are not dependent on the current state (traffic, topology etc.) of the network.

 Dynamic Routing (Adaptive Routing)  Routes being learned via exchange of routing information to reflect changes in the topology and traffic.

 Default Routing:  Traffic to destinations that are unknown to the router is sent to a default “outlet”.

Computer Networks - Network Layer 8

The Optimality Principle

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

 the set of optimal routes from all sources to a destination form a tree, called a sink tree , rooted at the destination.

I

r

1 J

r

2 K  The goal of all routing algorithms is to discover and use the sink trees for all routers.

Computer Networks - Network Layer 9

Routing Algorithms

   Static Routing Algorithms  Shortest Path Routing   Flooding Flow-Based Routing Dynamic Routing Algorithms   Distance Vector Routing Link State Routing Hierarchical Routing  Routing for Mobile Hosts  Broadcast Routing  Multicast Routing Computer Networks - Network Layer 10

Shortest Path Routing

 Find the shortest path between a given pair of routers.

 Cost of a link may be a function of the distance, bandwidth, average traffic, communication cost, mean queue length, delay, etc.

 The Dijkstra’s algorithm is used.

Computer Networks - Network Layer 11

Flooding

 Every incoming packet is sent out on every outgoing line except the one it arrived on.

 Vast numbers of duplicate packets are generated.

I M  For robustness J K  Application: L  Concurrent updates of databases  Always choose the shortest path Computer Networks - Network Layer 12

Flow-Based Routing

 For a given line, if the capacity and average flow are known in advance, it is possible to compute the mean packet delay on that line from queueing theory.

 The routing problem then reduces to finding a routing algorithm that produces the minimum average delay for the subnet. Computer Networks - Network Layer 13

Distance Vector Routing

 RIP, the distributed Bellman-Ford routing algorithm, the Ford-Fulkerson algorithm  Each router maintains a routing table giving the best known distance to each destination and which line to use to get there.

 These tables are updated by exchanging information with the neighbors.

Computer Networks - Network Layer 14

Update Routing Table

E A I B Router C F G J (a) K D L H To A B C D E F G H I J K L A 0 12 25 40 14 23 18 17 21 9 24 29 JA delay is 8 I 24 36 18 27 7 20 31 20 0 11 22 33 JI delay is 10 H 20 31 19 8 30 19 6 0 14 7 22 9 JH delay is 12 Vectors received from J's four neighbors K 21 28 36 24 22 40 31 19 22 10 0 9 JK delay is 6 New estimated delay from J Line 8 20 28 20 17 30 18 12 10 0 6 15 New routing table for J A A I H I I H H I K K (b) Computer Networks - Network Layer 15

Distance Vector Routing

 Metric used to measure the “distance”  number of hops  time delay  queue length  Drawback  it reacts rapidly to good news, but leisurely to bad news.

Computer Networks - Network Layer 16

Count-to-Infinity Problem

A B C D E A B C D E     1    1 1 2 2   3  1 2 3 4 down initially and come up later Good News Initially After 1 exchange After 2 exchanges 1 3 3 2 2 4 3 3 3 After 3 exchanges 5 4 5 4 After 4 exchanges 5 6 5 6 After 5 exchanges 7 6 7 6 After 6 exchanges 7 8 7 8 alive initially and down later     Bad News 4 4 4 Computer Networks - Network Layer 17

Link State Routing

 IS-IS, CLNP, NLSP, OSPF  Each route must 1.Discover its neighbors and learn their network addresses.

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.

Computer Networks - Network Layer 18

Learning About the Neighbors

 Send a special HELLO packet on each point-to-point line  the router on the other end is expected to send back a reply telling who it is L I HELLO I am J J K Computer Networks - Network Layer 19

Measuring Line Cost

 Send an ECHO packet over a line  the other side is required to send back ECHO immediately  the round-trip delay can be mesaured  if the load is taken into account  results in better performance  the routing table may be oscillate wildly Computer Networks - Network Layer 20

Building Link State Packets

B 2 C 4 A 5 1 6 E 8 F 7 3 D (a) A Seq.

Age B 4 E 5 Link B Seq.

Age A 4 C 2 F 6 State C Seq.

Age B 2 D 3 E 1 D Seq.

Age C 3 F 7 Packets E Seq.

Age A 5 C 1 F 8 F Seq.

Age B 6 D 7 E 8 (b) Computer Networks - Network Layer 21

Distributing Link State Packets

 Use flooding  sequence number is used to determine among new, duplicate, or obsolete packets  three problems  sequence number may wrap around  a crash router will lose track of its sequence number when it restarts  a corrupted bit in sequence number may cause disaster Computer Networks - Network Layer 22

The Use of ‘Age’ Field

 Include in each packet  decremented once per second  when the age hits zero, the information from that router is discarded  also decremented by each router during the initial flooding process  no packet can get lost and live for an indefinite period of time Computer Networks - Network Layer 23

Reducing Flooding Costs

 When a link state packet comes in  it is put in a holding area to wait a short while  when another packet from the source comes in  duplicate: discarded  different: the older one is thrown out  all link state packets are acknowledged M I J K L Computer Networks - Network Layer 24

Computing the New Route

 Once a router has accumulated a full set of link state packets  it can construct the entire subnet graph by locally running Dijkstra’s algorithm  for a subnet with

n

routers, each of which has

k

neighbors, the memory required to store the input data is proportional to

kn.

Computer Networks - Network Layer 25

Hierarchical Routing

 When hierarchical routing is used, the routers are divided into regions  each router knows all the details about how to route packets to destinations within its own region  each router knows nothing about the internal structure of other regions.

Computer Networks - Network Layer 26

Hierarchical Routing

Region 1 B A A C B Region 3 B A C Region 4 Region 2 A C D B C B D A Region 5 Dest. Line Hops 1A --- -- 1B 1B 1 1C 1C 1 2A 1B 2 2B 1B 3 2C 1B 3 2D 1B 4 3A 1C 3 3B 1C 2 4A 1C 3 4B 1C 4 4C 1C 4 5A 1C 4 5B 1C 5 5C 1B 5 5D 1C 5 Computer Networks - Network Layer Dest. Line Hops 1A --- -- 1B 1B 1 1C 1C 1 2 1B 2 3 1C 2 4 1C 3 5 1C 4 Hierarchical table for 1A Full table for 1A 27

Routing for Mobile Hosts

 Each mobile node is assumed to have a permanent home location that never changes.

 Each area has one or more foreign agents , which keep track of all mobile nodes visiting the area.

 In addition, each area has a home agent , which keep track of nodes whose home is in the area, but who are currently visiting another area.

 When a new node enters an area, it must register itself with a foreign agent there. Then the mobile node will register either directly with its home agent, or through the foreign agent which forwards the registration to the home agent.

Computer Networks - Network Layer 28

Routing for Mobile Hosts

Home Foreign Foreign Computer Networks - Network Layer 29

Routing for Mobile Hosts

 Datagrams sent to the mobile node are  intercepted by its home agent, then  tunneled by the home agent towards the mobile node,  received at the tunnel foreign agent, and  finally delivered to the mobile node.

Computer Networks - Network Layer 30

Routing for Mobile Hosts

1. Packet is sent to the mobile host’s home 3. Sender is given foreign agent’s address 4. Subsequent packets are tunneled to the foreign agent 2. Packet is tunneled to the foreign agent Computer Networks - Network Layer 31

Broadcast Routing

 To simply send a distinct packet to each destination  Flooding  Multidestination Routing  Spanning Tree Routing  Reverse Path Forwarding Computer Networks - Network Layer 32

Multidestination Routing

 Each packet contains a list of desired destinations.

 When a packet arrives, the router checks all the destinations to determine the set of output lines for forwarding the packet. An output line is selected if it is the best route to at least one of the destinations.

 The router generates a new copy of the packet for selected output line, with a set of destinations that are to use the line.

Computer Networks - Network Layer 33

Spanning Tree Routing

 Assume each router has knowledge of a spanning tree (e.q. a sink tree) in the network.

 Each router copies an incoming broadcast packet onto all the spanning tree lines except the one it arrives on.

 Use minimum number of packets.

Computer Networks - Network Layer 34

Reverse Path Forwarding

 Without knowing any spanning tree if a packet arrives at the line that is normally used for sending packets to the source of the broadcast the router forwards copies of it onto all lines except the one it arrived on.

otherwise the packet is discarded Computer Networks - Network Layer 35

Reverse Path Forwarding: An Example

I A B I C F D G F H J E H N J N A D E K G O M O L K O E C G D N K M H B L Preferred link L B Computer Networks - Network Layer 36

Multicasting

 Send a message to all the other members of the group  group management  create and destroy groups  for processes to join and leave groups  routers knows which of their hosts belong to which group  routers tell their neighbors, so the information propagates through the subnet Computer Networks - Network Layer 37

Multicast Routing

 Each router computes a spanning tree covering all other routers in the subnet.

 When a multicast packet for a group arrives, the first router examines its spanning tree and prunes it, removing all lines that do not lead to hosts in the group.

 Multicast packets are forwarded only along the pruned tree.

mn

trees is needed with

n

groups, each with an average of

m

members.

Computer Networks - Network Layer 38

Core-based Tree for Multicast Routing

 A single spanning tree,called core-based tree, for a group is computed, with the root (core) near the middle of the group.

 A host first sends a multicasting message to the core, which then does the multicasting along the spanning tree.

 The tree is not optimal. However only

n

trees need to be stored.

Computer Networks - Network Layer 39

Congestion

 When too many packets are present in (a part of) a subnet, performance degrades. This situation is called congestion.

Maximun carrying capacity of subnet Perfect Desirable Congested Packet sent Computer Networks - Network Layer 40

Congestion Control

 goal  make sure the subnet is able to carry the offered traffic  Congestion causes  bursty data  insufficient memory  slow processor  low-bandwidth line Computer Networks - Network Layer 41

Flow Control vs. Congestion Control

Super Computer 1000 Gbps Flow Control 1 Gbps PC Congestion Control 100 Kbps 1 Mbps 1000 Computer Networks - Network Layer 1000 42

General Principles

 Open Loop  make sure congestion does not occur in the first place  Closed Loop  monitor the system to detect congestion (where and when)  pass this information to places where action can be taken  adjust system operation to correct the problem Computer Networks - Network Layer 43

Congestion Control Algorithm Taxonomy

 explicit feedback  Packets are sent back from the point of congestion to warn the source.

 implicit feedback  The source deduces the existence of congestion by making local observations, such as the acknowledgement time.

Computer Networks - Network Layer 44

Congestion Prevention Policies

 Virtual circuit versus datagram  Most algorithms work only with virtual circuit.

 Packet queueing and service policy  input queueing versus output queueing  round robin, priority-based, random, ...

 Packet discarded policy   which packet is dropped when there is no space Routing algorithm  Load sharing  Packet lifetime management Computer Networks - Network Layer 45

Traffic Shaping/Policing

 Congestion would be less common if traffic is less bursty  traffic shaping  force packets to be transmitted at a more predictable rate  traffic policing  monitor a traffic flow Computer Networks - Network Layer 46

Leaky Bucket Algorithm

Water drips out of the hole at a constant rate.

interface implementing the leaky bucket algorithm packets Network unregulated flow The bucket holds packets.

regulated flow Computer Networks - Network Layer 47

Token Bucket Algorithm

Before packets The bucket holds packets.

tokens added periodically After tokens The bucket holds tokens.

Network Network Computer Networks - Network Layer 48

Properties of Token Bucket

 allows saving up permission to send large bursts later  throws away token when the bucket fills up  but never discards packets

C

: token bucket capacity;  :token arrival rate;

S

: burst length;

M

: maximal output rate

C

+ 

S

=

MS

Computer Networks - Network Layer 49

Flow Specification

 An agreement on the traffic pattern  the source gives the flow specification to the subnet for approval Characteristics of the input Service Desired Maximal packet size (bytes) Token bucket rate (bytes/sec) Token bucket size (bytes) Maximal transmission rate (bytes/sec) Loss sensitivity (bytes) Loss interval (  sec) Burst loss sensitivity (packets) Min. delay noticed (  sec) Max. delay variation (  sec) Quality of guarantee Computer Networks - Network Layer 50

Congestion Control in Virtual Circuit Subnets

 Admission control  once congestion has been signaled, no more virtual circuits are set up until the problem has gone away  carefully route all new virtual circuits around problem areas  negotiate an agreement between the host and subnet when a virtual circuit is set up Computer Networks - Network Layer 51

Choke Packets

1 Heavy flow 6 2 5 7 Flow is reduced.

Computer Networks - Network Layer 3 Choke 4 52

Hop-by-Hop Choke Packets

1 2 Heavy flow To provide quick relief at the point of congestion at the price of using up more buffers upstream.

5 Flow is reduced.

Computer Networks - Network Layer 3 Choke 4 53

Load Shedding

 when routers are being inundated by packets that they can not handle, they just throw them away.

 Packet discarding policy  Wine: Old is better than new.

 Milk: New is better than old.

 Priority Control Computer Networks - Network Layer 54

Jitter Control

 The jitter is the amount of variation in the end-to end packet transit time.

 The jitter can be bounded by computing the expected transit time for each hop along the path. When a packet arrives at a router, the router checks to see how much the packet is behind or ahead of its schedule. This information is stored in the packet and updated at each hop. If the packet is ahead of schedule, it may be held just enough to get it back on schedule. If it is behind schedule, the router tries to get it out the door quickly.

Computer Networks - Network Layer 55

Congestion Control for Multicasting

 Multicast flows from multiple sources to multiple destinations (cable television)  if it is the sender that reserves bandwidth  each sender should track membership changes  regenerate the spanning tree at each change  RSVP (Resource reSerVation Protocol)  it is the receiver that reserves bandwidth Computer Networks - Network Layer 56

RSVP (Resource reSerVation Protocol)

 allows multiple senders to transmit multiple groups of receivers.

 permits individual receivers to switch channels freely.

 optimizes bandwidth use while at the same time eliminating congestion.

 uses multicast routing using spanning trees Computer Networks - Network Layer 57

Multicast Spanning Trees

1 Senders 2 Multicast spanning tree for host 1 1 2 Multicast spanning tree for host 2 1 2 3 4 Receivers 5 3 4 5 Computer Networks - Network Layer 3 4 5 58

Bandwidth Reservation

1 Senders 2 1 Senders 2 1 Senders 2 Bandwidth reserved for source 1 Bandwidth reserved for source 2 Bandwidth reserved for source 1 3 4 Receivers 5 3 4 5 Receivers Computer Networks - Network Layer 3 4 5 59

RSVP (Resource reSerVation Protocol)

 When making a reservation, a receiver can (optionally) specify one or more sources that it wants to receive from.

 It can also specify whether these choices are fixed for the duration of the reservation, or whether the receiver wants to keep open the option of changing sources later.

Computer Networks - Network Layer 60

RSVP (Resource reSerVation Protocol)

 Two receivers are only set up to share a path if they both agree not to change sources later on.

 Once a receiver has reserved bandwidth, it can switch to another source and keep that portion of the existing path that is valid for the new source.

Computer Networks - Network Layer 61

Internetworking

802.5 LAN DECnet R R 802.3 LAN 802.4 LAN B Computer Networks - Network Layer X.25

R R SNA 62

Internetworking

7 Application 6 Presentation 5 Session 4 Transport 3 Network 2 Data Link 1 Layer Physical Host A Application Protocol Presentation Protocol Session Protocol Transport Protocol Internal Subnet Protocol Network Network Data Link Data Link Physical Physical Router Router Computer Networks - Network Layer Application APDU Presentation PPDU Session SPDU Transport TPDU Network Packet Data Link Frame Physical Host B Bit 63

Internetworking Devices

 Layer 1: Repeater or Amplifier  To amplify or regenerate signals  Layer 2: (Multi-protocol) Bridge  Store-and-forward device  Headers at layer 2 are translated if necessary.

 Layer 3: (Multi-protocol) Router  Headers at layer 3 (and layer 2) are translated if necessary.

 Layer 4~7: Transport/Application Gateway Computer Networks - Network Layer 64

Devices on the Market

 Repeater, Hub  Bridge  (Multi-protocol) Router, Layer 3 Switch  Layer 4 Switch  Gateway with interfaces of distinct layer protocols  Bridge/Router (or called B-Router) Computer Networks - Network Layer 65

How Networks Differ

 Service offered  Connection-oriented versus Connectionless  Protocol  IP, IPX, CLNP, AppleTalk, DECnet, etc.

 Addressing  Flat (802) versus hierarchical (IP, PDN, PSTN, ISDN, etc.)  Multicasting/Broadcasting  Present or absent Computer Networks - Network Layer 66

How Networks Differ (Cont.)

 Packet size  Every network has its own maximum  Quality of service  Present or absent  Error handling  Reliable, ordered, and unordered delivery  Flow control  Sliding window, rate control, others, or none Computer Networks - Network Layer 67

How Networks Differ (Cont.)

 Congestion control  Leaky bucket, choke packets, etc.

 Security  Privacy rules, encryption, etc.

 Parameters  Different timeouts, flow specifications, etc.

 Accounting  By connection time, by packet, by byte, or not at all Computer Networks - Network Layer 68

Concatenated Virtual Circuit

SNA Multiprotocol Router ATM M Router 1 X.25

M OSI Host M M 2 Computer Networks - Network Layer 69

Connectionless Interworking

1 M M M M Computer Networks - Network Layer 2 70

Tunneling

Using encapsulation of IP packets Ethernet WAN R R The same type of network Ethernet Ethernet frame IP WAN packet IP Ethernet frame IP Ethernet header WAN packet header Computer Networks - Network Layer Ethernet header 71

Internetwork Routing

 interior gateway protocol: within each network  exterior gateway protocol: between networks A B 2 B 1 E Network A C Gateway/ Router 4 F 3 5 D E C F D Computer Networks - Network Layer 72

Autonomous System (AS)

 An autonomous system is a set of routers having a single routing policy, running under a single technical administration.

 Each AS is independent of all the others.

Computer Networks - Network Layer 73

Fragmentation and Reassembly

 Each network imposes some maximum size on its packets  When a large packet wants to travel through a network whose maximum packet size is too small  allow gateway to break packets up into fragments  fragments are reassembled into packet latter Computer Networks - Network Layer 74

Transparent and Nontransparent Fragmentation

Network 1 Network 2 Packet G1 G2 G3 G4 G1 fragments a large packet G2 reassembles the fragments (a) G3 fragments again G4 reassembles again Packet G1 G2 G3 G4 G1 fragments a large packet The fragments are not reassembled until the final destination (a host) is reached (b) Computer Networks - Network Layer 75

Elementary Fragmentation

Number of the first elementary fragment in this packet Packet number End of packet bit 1 byte 27 0 1 A B C D E F G H Header (a) I J 27 0 0 A B C D E F G H Header (b) 27 0 0 A B C D E Header 27 5 0 F G H Header (c) 27 8 1 I Header J 27 8 1 Header I J Computer Networks - Network Layer 76

Firewalls

 Packet filter router is a router equipped with some extra functionality that allows every incoming or outgoing packet to be inspected.

 Application gateway (e.g.a mail gateway) may examine headers and/or contents of messages.

Packet Filtering Router Application Gateway Packet Filtering Router Computer Networks - Network Layer 77

Internet Network Layer Protocol

 The IP (Internal Protocol) Protocol  IP Addressing  Subnets  Internet Control Protocols  The Internet Control Message Protocol (ICMP)  The Address Resolution Protocol (ARP)  The Reverse Address Resolution Protocol (RARP) Computer Networks - Network Layer 78

Internet Network Layer Protocol

 The Interior Gateway Routing Protocol: Open Shortest Path First (OSPF)  The Exterior Gateway Routing Protocol: Border Gateway Protocol (BGP)  Internet Multicasting  Mobile IP  Classless InterDomain Routing (CIDR)  IPv6 Computer Networks - Network Layer 79

The IP Header

0 Version 4 8 IHL Type of service 16 Identification 19 24 Total length D F M F Fragment offset 31 bit Time to live Protocol Header checksum Source address Destination address Options (0 or more words) Computer Networks - Network Layer 80

The IP Protocol

 Version: The current protocol version is 4.

 IP Header length (IHL): measured in 32-bit words  for example, without options, its value is 5.

 Type of service  Precedence (3 bits): 0 (normal precedence) ~ 7 (network control)  Delay (1 bit): low delay  Throughput (1 bit): high throughput  Reliability (1 bit): high reliability  unused (2 bits) Computer Networks - Network Layer 81

The IP Protocol

 Total length: measured in octets, including the length of the header and data  Identification: datagram identifier  Flags   unused (1 bit) DF (1 bit): don’t fragment  MF (1 bit): more fragment  Fragment offset: the offset of this fragment in the original datagram, measured in units of 8 octets Computer Networks - Network Layer 82

The IP Protocol

 Time to live (TTL): packet lifetime, measured in seconds (hops, in practice)  Protocol: protocol type (e.g., TCP, UDP, ...), RFC 170  Header checksum  Source IP address  Destination IP address  Options  Padding: to make the header extend to an exact multiple of 32 bits, containing 0 Computer Networks - Network Layer 83

IP Options

 Security  to specify how secret the datagram is  Strict source routing  to give the complete path to be followed  Loose source routing  to give a list of routers not to be missed  Record route  to make each router append its IP address  Timestamp  to make each router append its address and timestamp Computer Networks - Network Layer 84

IP Option Code

 Copy (1 bit):  0: the option will only be copied into the first fragment and not to all fragments  1: the option should be copied into all fragments  Class (2 bits)  0: datagram or network control  1: reserved  2: debugging and measurement  3: reserved  Number (5 bits) Computer Networks - Network Layer 85

IP Option Number

Class Number Length 0 0 0 0 0 0 0 2 0 1 2 3 7 8 9 4 1 1 11 var var 4 var var Description end of option list no operation security and handling restriction loose source routing record route stream identifier strict source routing internet timestamp Computer Networks - Network Layer 86

IP Addressing

 32 bits long, represented in dotted decimal notation, like 192.41.6.20

 Network number + Host number  Network numbers are assigned by the NIC (Network Information Center) to avoid conflicts.

 All the hosts in a network must have the same network number.

Computer Networks - Network Layer 87

IP Addresses

1 2 3 Range of host Class 01234567890123456789012345678901 addresses A 0Network Host 1.0.0.0 to 127.255.255.255

B 10 Network Host 128.0.0.0 to 191.255.255.255

C 110 Network Host D 1110 Multicast address E 11110 Reserved for future use Computer Networks - Network Layer 192.0.0.0 to 223.255.255.255

224.0.0.0 to 239.255.255.255

240.0.0.0 to 247.255.255.255

88

Special IP Addresses

00000000000000000000000000000000 This host 00 00 Host A host on this network 11111111111111111111111111111111 Broadcast on the local network Network 11 11 Broadcast on a distant network 127 (anything) Loopback Computer Networks - Network Layer 89

Network Growth Problem

 Problem  Immense administrative overhead  Every time a new network is installed the system administrator has to contact NIC to get a new network number.

 Then this number must be announced worldwide.

 Large routing table  Solution: To minimize network numbers by sharing one network number among multiple physical networks Computer Networks - Network Layer 90

Subnet Addressing

•ack like a single network to the outside world •split into several parts for internal use Network 128.10.1.0

128.10.1.1

128.10.1.2

128.10.0.0

G 128.10.2.1

128.10.2.2

Network 128.10.2.0

Computer Networks - Network Layer 91

Subnets

A Class B Network IP address Host Part Network Subnet Host Subnet mask 11 11 11 11 00 00  The standard does not restrict subnet masks to select contiguous bits of the address.

Computer Networks - Network Layer 92

How Router Processes IP Packets

network0 network1 M A B N (this-net, subnet, 0) (this-net, this-sub, host1) IP X IP Y (network0, 0) (network1, 0) ...

IP A IP B ...

(this-net, host0) IP M (this-net, host1) IP N ...

...

(default router) When subnetting is introduced Computer Networks - Network Layer 93

The Internet Control Message Protocol (ICMP)

Message type Destination unreachable Description Packet could not be delivered Time exceeded Parameter problem Source quench Redirect Echo request Echo reply Timestamp request Timestamp reply Time to live field hit 0 Invalid header field Choke packet Teach a router about geography Ask a machine if it is alive Yes, I am alive Same as Echo request, but with timestamp Same as Echo reply, but with timestamp Computer Networks - Network Layer 94

The Internet Control Message Protocol (ICMP)

 RFC 792  Each ICMP message has its own format.

 Example: Echo request or reply  Type=8: request,  Code=0 Type=0: reply Type IP header Code Identifier Checksum Sequence number Optional data Computer Networks - Network Layer 95

The Address Resolution Protocol (ARP)

 RFC 826  To map an IP address onto data link layer address, such as Ethernet.

 An IP host runs the ARP protocol to inquiry the unknown data link layer address of a destination IP address before a datagram is sent.

 The ARP of a host may maintain a cache to record known IP address and DLL address pairs.

 A machine may broadcast its own mapping when it boots by using ARP.

Computer Networks - Network Layer 96

The Reverse Address Resolution Protocol (RARP)

 RFC 903  Allow a newly-booted (diskless) workstation (with a DLL address) to discover its IP address  Need a RARP server on each network  Bootp, RFCs 951, 1048, and 1084  Use UDP messages which are forwarded over routers to find the file server that holds the mapping Computer Networks - Network Layer 97

The Interior Gateway Routing Protocol

 A Routing Protocol within an autonomous system (AS).

 Internet interior gateway protocol  Original: a distance vector protocol, Routing Information Protocol (RIP), based on the Bellman-Ford algorithm  Successor (1979): a link state protocol  Now (1990): Open Shortest Path First (OSPF), RFC 1247 (ver. 1) and RFC 1583 (ver. 2).

Computer Networks - Network Layer 98

Objectives of OSPF

 published in the open literature  to support a variety of distance metrics: distance, delay, ...

 a dynamic algorithm  to support routing based on type of service  load balancing  support for hierarchical systems  security  tunneling Computer Networks - Network Layer 99

Graph Representation of an AS

 OSPF computes the shortest path from every router to every other router.

A B C A B C Each arc is assigned a cost router WAN LAN Computer Networks - Network Layer 100

Areas and Backbone Areas

 An AS can be divided into numbered

areas

 an area is a network or a set of continuous networks (a generalization of a subnet)  areas do not overlap  Within an area, each router has the same link state databases and runs the same shortest path algorithm  backbone area (area 0)  all areas within an AS are connected to the backbone, possibly by tunnels Computer Networks - Network Layer 101

Classes of Routers

backbone router area border router internal router BGP protocol connects the ASes AS backbone area AS boundary router Computer Networks - Network Layer router 102

Open Shortest Path First (OSPF)

 Type of service routing: multiple graphs  one labeled with the costs when delay is the metric  one labeled with the costs when throughput is the metric  one labeled with the costs when reliability is the metric  Three kinds of routes: intra-area, inter-area and inter-AS.

Computer Networks - Network Layer 103

OSPF Messages

Message type Hello Link state update Link state ack Description Used to discover who the neighbors are Provides the sender’s costs to its neighbors Acknowledges link state update Database description Announces which updates the sender has Link state request Requests information from the partner Computer Networks - Network Layer 104

OSPF Messages

 When a router boots, it sends HELLO messages on all of its point-to-point lines and multicasts then on LANs to the group consisting of all the other routers.

 During normal operation, each router periodically floods LINK STATE UPDATE messages to each of its adjacent routers. Routers also send these messages when a line goes up or down or its cost changes.

Computer Networks - Network Layer 105

OSPF Messages

 DATABASE DESCRIPTION messages give the sequence numbers of all the link state entries currently held by the sender. By comparing its own values with those of the sender, the receiver can determine who has the most recent values. These messages are used when a line a brought up.

Computer Networks - Network Layer 106

The Exterior Gateway Routing Protocol

 A Routing Protocol between ASes  The main goal of an interior gateway protocol is to route efficiently, while the exterior gateway protocols have to worry about “politics”.

 Border Gateway Protocol (BGP)  described in RFC 1654  BGP1 in 1989, current version BGP4 in 1993.

 fundamentally a distance vector protocol.

Computer Networks - Network Layer 107

Policies

 Political, security, or economic considerations  No transit traffic through certain ASes.

 Never put Iraq on a router starting at the Pentagon.

 Only transit Albania if there is no alternative to the destination.

 Traffic starting or ending at IBM should not transit Microsoft.

Computer Networks - Network Layer 108

Border Gateway Protocol (BGP)

 Each BGP keeps track of the exact path used to each destination A E F B I C D

Information

F

receives from its neighbors about

D

G H

From B: “I use BCD” From G: “I use GCD” From I: “I use IFGCD” From E: “I use EFGCD”

J Computer Networks - Network Layer 109

Border Gateway Protocol (BGP)

 After all the paths come in from the neighbors, the best can be determined.

 Since each router keeps the exact routes used, the count-to-infinite problem can be easily solved.

 BGPs uses TCP as its transport protocol (port 179) for reliable transmission.

Computer Networks - Network Layer 110

A E

How BGP Solves The Count-to Infinity Problem

B F I C G J D

Information

F

receives from its neighbors about

D

H

From B: “I use BCD” Nothing from G From I: “I use IFGCD” From E: “I use EFGCD” F chooses “FBCD” as its new route

Computer Networks - Network Layer 111

Internet Multicasting

    IP supports multicasting using class D addresses.

Permanent addresses and temporary addresses.

 Permanent addresses  224.0.0.1 all systems on a LAN  224.0.0.2 all routers on a LAN  224.0.0.5 all OSPF routers on a LAN  224.0.0.6 all designated routers on a LAN A multicast router uses the IGMP (Internet Group Management Protocol) to group hosts the groups their processes currently belong to.

IGMP in RFC 1112.

 Multicast routing uses spanning trees.

Computer Networks - Network Layer 112

IGMP (Internet Group Management Protocol)

Query 1, 3 1, 2 Multicast router Hardware Multicast Response 1, 3 Multicast router 1, 2 3 Computer Networks - Network Layer 3 113

Mobile IP

 Problems with host mobility in Internet  IP address implies host location  Major goals of Mobile IP  Mobile host can use its home IP address anywhere.

 Software changes to the fixed hosts were not permitted  changes to the router software and tables were not permitted  most packets for mobile hosts should not make detours on the way  no overhead should be incurred when at home Computer Networks - Network Layer 114

How to Handle Mobility

Sender Home agent Packet for mobile host care-of-address Foreign agent Mobile host register care-of-address He is here (tunneling) Packet for mobile host

Computer Networks - Network Layer 115

Gratuitous ARP

Packet for mobile host Router at home’s LAN Packet for mobile host Home agent ARP Query ARP Response Packet for mobile host Mobile Host gratuitous ARP (tunneling) (about to move)

Computer Networks - Network Layer 116

IP Addressing Problems

 32-bit IP address space is not enough  Organizing the address space by classes wastes millions of them  a class B address is far too large for most organizations  the routing table explosion  every router in the Internet would need a table with half a million entries, if that much class C networks are in use Computer Networks - Network Layer 117

Classless InterDomain Routing (CIDR)

 To solve the IP address depletion problem and the routing table explosion problem  RFC 1519  The basic idea behind CIDR is to allocate the remaining class C networks in variable sized blocks 192.0.0.0

223.255.255.255

Computer Networks - Network Layer 118

Example

 X University needs 2048 addresses and is assigned the addresses 194.24.0.0 through 194.24.7.255, along with mask 255.255.248.0.

 Y University needs 4096 addresses and is assigned the addresses 194.24.16.0 through 194.24.31.255, along with mask 255.255.240.0.

 Z University needs 1024 addresses and is assigned the addresses 194.24.8.0 through 194.24.11.255, along with mask 255.255.252.0.

Computer Networks - Network Layer 119

Example

 Routing table with entries  base address: 194.24.0.0, mask: 255.255.248.0

 base address: 194.24.16.0, mask: 255.255.240.0

 base address: 194.24.8.0, mask: 255.255.252.0

 Destination address with 194.24.17.4 matching the second entry, so the packet is sent to the Y router.

Computer Networks - Network Layer 120

Classless InterDomain Routing (CIDR)

 The world was partitioned into zones, each given a portion of the class C address space:      Addresses 194.0.0.0 to 195.255.255.255 for Europe Addresses 196.0.0.0 to 197.255.255.255 for Others Addresses 198.0.0.0 to 199.255.255.255 for North America Addresses 200.0.0.0 to 201.255.255.255 for Central and South America Addresses 202.0.0.0 to 203.255.255.255 for Asia and Pacific   Addresses 204.0.0.0 to 207.255.255.255 for Others Addresses 208.0.0.0 to 223.255.255.255 reserved for future use Computer Networks - Network Layer 121

IP Address Allocation

  Class A address allocation is restricted.

Class B address are also restricted .They will be allocated only if the need for them is justified.

 Class C addresses are allocated with a contiguous block of addresses which consists of several contiguous class C addresses.Class C addresses are being distributed to ISPs so that the allocation could last at least two years.

 If a subscriber has a requirement for more than 4096 IP address, a Class B network number may be allocated.

 Organizations are encouraged to use Variable Length Subnet Mask for efficient use of address space.

Computer Networks - Network Layer 122

IPv6

 A modified combined version of Deering and Francis proposals. SIPP (Simple Internet Protocol Plus)  Longer addresses  Simplification of headers  Support for options  Security and authentication  Type of services Computer Networks - Network Layer 123

The IPv6 Header

0 4 8 Version Priority Payload length 16 Flow label Next header 24 31 Hop limit Source address (16 bytes) Destination address (16 bytes) Computer Networks - Network Layer 124

The IPv6 Protocol

 Version: 6  Priority  0~7: for transmission possibly slowed down in case of congestion  8~15: for real time traffic with constant sending rate  suggestion  1: news  4: FTP  6: Telnet Computer Networks - Network Layer 125

The IPv6 Protocol

 Flow label: for setting up a pseudo connection with particular properties and requirements  Payload length: information bytes following the 40 byte header  Next header: specify which of the (currently) six extension headers, if any, follows the header. If the header is the last IP header, the Next header specifies the transport protocol handler.

 Hop limit: for limiting packet lifetime  Source address and Destination address Computer Networks - Network Layer 126

IPv6 Address Expression

 Written as eight groups of four hexadecimal digits with colons between groups 8000:0000:0000:0000:0123:4567:89AB:CDEF  optimizations 8000::123:4567:89AB:CDEF  IPv4 addresses ::192.31.20.46

Computer Networks - Network Layer 127