IP Int nter ernet networ orking king 1 Sending Datagrams from - - PDF document

ip int nter ernet networ orking king
SMART_READER_LITE
LIVE PREVIEW

IP Int nter ernet networ orking king 1 Sending Datagrams from - - PDF document

CMPE 252A: Computer Networks Set 9b: IP Int nter ernet networ orking king 1 Sending Datagrams from Source to Destination IP datagram: remains unchanged, as it travels from source to destination misc source dest data IP addr fields


slide-1
SLIDE 1

1

1

CMPE 252A: Computer Networks Set 9b:

IP Int nter ernet networ

  • rking

king

2

Sending Datagrams from Source to Destination

IP datagram: remains unchanged, as it travels from source to destination

misc fields source IP addr dest IP addr data

  • Dest. Net. next router Nhops

223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2

Forwarding table at A:

223.1.1.1 223.1.1.2 223.1.1.3 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27

A B E

223.1.1.4

223.1.1 223.1.3 223.1.2

3

Sending Datagrams from Source to Destination

  • Dest. Net. next router Nhops

223.1.1 1 223.1.2 223.1.1.4 2 223.1.3 223.1.1.4 2

Forwarding table at A:

223.1.1.1 223.1.1.2 223.1.1.3 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27

A B E

223.1.1.4

223.1.1 223.1.3 223.1.2

Starting at A, dest. E:

Look up network address of E in forwarding table

E is on a different network

 A, E not directly attached 

Routing table: next hop router to E is 223.1.1.4

Link layer sends datagram to router 223.1.1.4 inside link- layer frame

Datagram arrives at 223.1.1.4

misc fields 223.1.1.1 223.1.2.2 data

slide-2
SLIDE 2

2

4

Sending Datagrams from Source to Destination

223.1.1.1 223.1.1.2 223.1.1.3 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27

A B E

223.1.1.4

223.1.1 223.1.3 223.1.2

  • Dest. Net router Nhops interface

223.1.1 - 1 223.1.1.4 223.1.2 - 1 223.1.2.9 223.1.3 - 1 223.1.3.27

Forwarding table at router Arriving at 223.1.4, destined for 223.1.2.2

Look up network address of E in router’s forwarding table

E on same network as router’s interface 223.1.2.9

 Router and E are directly

attached

Link layer sends datagram to 223.1.2.2 inside link-layer frame via interface 223.1.2.9

Datagram arrives at 223.1.2.2

misc fields

223.1.1.1 223.1.2.2 data

5

Differences between Intra- and Inter-AS Routing

Policy:

 Inter-AS: admin wants control over how its traffic is

routed, and who routes through its net.

 Intra-AS: single administration, so no policy decisions

needed (usually; changing with traffic engineering)

 Scale:  Hierarchical routing saves table size, reduced update

traffic Performance:

 Intra-AS: can focus on performance  Inter-AS: policy dominates over performance

Customers and Providers in The Internet

Cus ustomer

  • mer pay

pays pr provider ider for

  • r acces

access to

  • the

he Int nter ernet net

pr provider ider

cus customer

  • mer

IP traf affic ic

pr provider ider cus customer

  • mer
slide-3
SLIDE 3

3 “Peering” Relationships

peer peer peer peer cus customer

  • mer

pr provider ider

Peer eers a) a) Ena nable ble trans ansit it among among their heir res espect pectiv ive e cus customer

  • mers

b) b) Prohibit

  • hibit trans

ansit it bet between een peer peers Peer eers (of

  • ften)

en) do do not not exchange hange pay payment ments traf affic ic allo allowed ed traf affic ic NO NOT allo allowed ed

Peering Provides Shortcuts

Peer eering ing als also

  • allo

allows connect connectiv ivit ity bet between een the he cus customer

  • mers of
  • f “Tier

ier 1” pr provider iders. .

peer peer peer peer cus customer

  • mer

pr provider ider

ICNP 2002

ARD != AS

 ASNs are 16-bit values; more than 11,000 in

use.

 Most ARDs have no ASN (statically routed at

Internet edge)

 Some unrelated ARDs share the same ASN (RFC

2270)

 Some ARDs are implemented with multiple ASNs

(example: Worldcom)

ASes es ar are e an an implement implementation ion det detail ail of

  • f

Int nter erdomain domain rout

  • uting

ing

slide-4
SLIDE 4

4

10

BGP

 BGP = Border Gateway Protocol  Is a Policy-Based routing protocol  Is the de facto EGP of today’s global Internet  Relatively simple, path-vector based, but configuration is

complex and many mistakes are made.

  • 1989

1989 : : BGP GP-1

  • 1 [RFC

FC 1105] 1105]

– Replacement eplacement for

  • r EGP

GP (1984, 1984, RFC FC 904) 904)

  • 1990

1990 : : BGP GP-2

  • 2 [RFC

FC 1163] 1163]

  • 1991

1991 : : BGP GP-3

  • 3 [RFC

FC 1267] 1267]

  • 1995

1995 : : BGP GP-4

  • 4 [RFC

FC 1771] 1771]

– Suppor upport for

  • r Clas

lassles less Int nter erdomain domain Rout

  • uting

ing (CIDR)

11

BGP

 BGP (Border Gateway Protocol): the de facto

standard for Internet inter-AS routing.

 Path Vector protocol:  Similar to Distance Vector protocol  Each Border Gateway broadcast to neighbors

(peers) entire path (i.e., sequence of ASes) to destination

 BGP routes to networks (ASes), not individual

hosts

 e.g., Gateway X may send its path to dest. Z:

Path (X,Z) = X,Y1,Y2,Y3,…,Z

12

BGP GP Oper Operat ation ion (Simplif implified) ied)

Establish session on TCP port 179

Exchange all

active routes

Exchange incremental updates

AS1 AS2

While connection is ALIVE exchange route UPDATE messages

BGP session

slide-5
SLIDE 5

5

13

BGP Messages

 BGP messages exchanged using TCP.  BGP messages:  OPEN opens TCP connection to peer and

authenticates sender

 UPDATE advertises new path (or withdraws

  • ld)

 KEEPALIVE keeps connection alive in absence

  • f UPDATES; also ACKs OPEN request

 NOTIFICATION reports errors in previous

msg; also used to close connection

 Announcement = prefix + attributes

14

Two

  • Types

pes of

  • f BGP

GP Neighbor Neighbor Relat elations ionships hips

  • External Neighbor (eBGP) in a

different AS.

  • Internal Neighbor (iBGP) in the same

AS.

AS1 AS2 eBGP iBGP

iB iBGP GP is is rout

  • uted

ed us using ing IGP GP

15

Problem:

  • blem:

iB iBGP GP Mes esh h Does

  • es Not

Not Scale cale

eBGP update

iBGP updates

  • N

N bor border der rout

  • uter

ers means means N( N(N-1) N-1)/2 2 peer peering ing ses essions ions

  • Eac

ach h rout

  • uter

er mus must ha have e N-1 N-1 iB iBGP GP ses essions ions conf configur igured ed

  • The

he ad addit dition ion a a sing ingle le iB iBGP GP speak peaker er requir equires es conf configur iguration ion changes hanges to

  • all

all

  • t
  • ther

her iB iBGP GP speak peaker ers

  • Siz

ize e of

  • f iB

iBGP GP rout

  • uting

ing table ble can can be be

  • r
  • rder

der N N lar larger ger than han number number of

  • f bes

best rout

  • utes

es (remember emember alt alter erna nate e rout

  • utes

es!) !)

  • Eac

ach h rout

  • uter

er has has to

  • lis

listen en to

  • upda

update e nois noise e from

  • m eac

each h neighbor neighbor

Cur urrent ently four

  • ur solut
  • lutions

ions: : (0) 0) Buy uy big bigger ger rout

  • uter

ers! ! (1) 1) Break eak AS int into

  • smaller

maller ASes es (2) 2) BGP GP Rout

  • ute

e ref eflect lector

  • rs

(3) 3) BGP GP conf confeder ederations ions

slide-6
SLIDE 6

6

16

  • Rout
  • ute

e ref eflect lector

  • rs can

can pas pass on

  • n iB

iBGP GP upda updates es to

  • client

lients

  • Eac

ach h RR pas passes es along along ONL ONLY bes best rout

  • utes

es

  • OR

ORIGI GINATOR OR_I _ID and and CLUS USTER_LI _LIST attribut ibutes es ar are e needed needed to

  • avoid
  • id

loops loops

RR RR RR RR RR RR

Rout

  • ute

e Ref eflect lector

  • rs

BGP Confederations

AS 65501 65501 AS 65502 65502 AS 65503 65503 AS 65504 65504 AS 65500 65500

AS 1 1

From

  • m the

he out

  • utside,

ide, this his looks looks lik like e AS 1 1

iB iBGP GP us used ed by by speak peaker ers in in conf confeder ederation ion

18

Problem:

  • blem: BGP

GP Rout

  • ute

e Proces

  • cessing

ing

Best Route Selection Apply Import Policies Best Route Table Apply Export Policies

Install forwarding Entries for best Routes. Receive BGP Updates Best Routes Transmit BGP Updates Apply Policy = filter routes & tweak attributes Based on Attribute Values

IP Forwarding Table

Apply Policy = filter routes & tweak attributes

Open ended programming. Constrained only by vendor configuration language

Instability due to ad hoc filtering rules

slide-7
SLIDE 7

7 Problem: Active BGP Entries

19

Plot Range: 30-Jun-1988 (1430) to 07-Nov-2013

Approaching 500K!

20

Additional Control

 More than just route computation and

forwarding is needed for the Internet to work!

 Errors happen!  Different transmission media and networks

can tolerate different maximum packet sizes

 Hosts need to have IP addresses

21

Internet Control Protocols

 In addition to packet forwarding and keeping routing tables

correct, sending IP packets requires a number of control protocols:

 Host must be given an IP address (DHCP)  Application in host has the name of an intended destination, and an

IP address has to be found for that name.

 The application calls a resolver in the Domain Name System (DNS)

  • r uses a static hosts file (e.g., /etc/hosts)

 Host determines if destination IP address is the same or different.  If different, packet is sent to an attached (default) IP router.  If same, the IP address must be converted to a MAC address (ARP).  Destination router must also map IP address to MAC address (ARP).  Errors may have to be reported to the source of an IP packet using

a protocol (ICMP).

slide-8
SLIDE 8

8

22

Fragmentation

 Packet length is in bytes and includes header; maximum

length is then 65,535 bytes

 MAC protocol my not support such long packets, and an IP

packet may have to be fragmented.

 E.g., Ethernet accepts frames of up to 1500 bytes; FDDI of up to

4500 bytes

 Each fragment is a self-contained datagram.  Fragmentation is handled with:

 The packet ID, which is the same for all fragment  The offset, which states the byte (position) of the fragment  A flag indicating that there a more fragments for the same ID

coming.

23

Fragmentation Example

Each datagram has a 20-byte header.

Re-assembly done at IP module of destination D.

Fragmentation is avoided in general by limiting the size of TCP segments to 536 B, because all data-link protocols must support MTUs

  • f 576 B. (536 + 20 of IP header + 20 of TCP header).

R

R R R R R

Length = 3980 B ID = 50 Max MTU size = 1500 B

ID = 50; length = 1480B; flag = 1 (more) ID = 50; length = 1480B; flag = 1 (more) ID = 50; length = 1020B; flag =0 (last)

D S

24

IPv4 Header

 TTL (time to live indicates how long the packet can stay in

the network; it is specified in hops and is decremented each time the packet is forwarded.

 Default is 64 hops; nodes can play with the field to limit the scope

 Protocol specifies the type of payload  Checksum is computed considering the entire header as a

sequence of 16-bit words, adding them up with 1’s complement arithmetic and taking the 1’s complement of the result.

 This checksum is NOT as powerful as a CRC but is simple to

do in software.

 Why this way? Because it is (was) done at each hop in

software

 What if we process headers in hardware?

slide-9
SLIDE 9

9

25

Error Reporting

 In general, errors can be reported to the origin of a

packet or to intermediate relays or both.

 In the IP Internet, errors are reported to the source

using ICMP (internet control message protocol).

 The choice stems from using IP for all signaling and

user data transfer in the Internet.

 ICMP messages are encapsulated in IP.  An IP packet specifies the source and destination

and not the relays (options are not supported in general)

26

ICMP: Internet Control Message Protocol

Used by hosts and routers for

 Error reporting:

unreachable host, network, port, protocol

 Echo request/reply (used

by ping)

Network-layer “above” IP:

 ICMP messages are carried

in IP datagrams

ICMP message: type, code plus first 8 bytes of IP datagram causing error

Type Code description 0 0 echo reply (ping) 3 0 dest. network unreachable 3 1 dest host unreachable 3 2 dest protocol unreachable 3 3 dest port unreachable 3 6 dest network unknown 3 7 dest host unknown 4 0 source quench (congestion control - not used) 8 0 echo request (ping) 9 0 route advertisement 10 0 router discovery 11 0 TTL expired 12 0 bad IP header

27

Address Resolution Protocol

 Goal: Enable a host to build a table of mappings

between IP addresses and MAC addresses in a dynamic manner.

 Mappings are called ARP cache or ARP table.  Approach:

 ARP is designed assuming a fully connected, broadcast

link layer (LAN) and the requestor is responsible for persisting.

 Hosts and routers broadcast requests and responses

and listen to requests and responses from any other node in the LAN.

 Different approach would be needed in a multihop LAN.

slide-10
SLIDE 10

10

28

protocol type

ARP

Hardware type = hardware interface type (e.g., Ethernet is 1)

HLEN and PLEN = length of MAC address and high-level protocol address

Protocol type = type of high-level protocol address (e.g., IP)

OPERATION = ARP request (1), ARP response (2), RARP request (3), RARP response (4).

hardware type 8 16 24 31

  • peration

PLEN HLEN sender MAC address sender IP address sender MAC address target MAC address sender IP address target MAC address target IP address

29

ARP

 Implementation considerations:

 Minimize the number of ARP requests sent  Queue requests for the same IP address  Learn form requests from others  Only one node is the target of an ARP  A node can act as a proxy for others

 Reverse ARP (RARP) provides the requestor

with its own IP address

 Nodes responding should play response

avoidance using randomized timers

30

Dynamic Host Configuration

 Host must be assigned an IP address, because it

is not committed to hardware as a MAC address.

 Configuring hosts with proper IP addresses is

involved.

 DHCP (dynamic host configuration protocol) is a

solution to this configuration and management problem.

 DHCP is intended to support manual, automatic

and dynamic configurations

 DHCP is designed to work with no pre-configured

addresses of servers and across networks.

slide-11
SLIDE 11

11

31

DHCP

my IP??? HOST

discover to broadcast IP address (all hosts and routers in LAN)

DHCP relay internet

unicast best effort to server

SERVER Host knows nothing, relay is configured with IP address of server Sever assigns IP addresses statically or dynamically Relies on end-to-end level datagrams (UDP) UDP specifies “DHCP”

32

DHCP: Dynamic Host Configuration Protocol

Goal: Allow host to dynamically obtain its IP address from network server when it joins network.

Can renew its lease on address in use Allows reuse of addresses (only hold address while connected an “on” Support for mobile users who want to join network (more shortly)

DHCP summary:

 host broadcasts “DHCP discover” msg  DHCP server responds with “DHCP offer” msg  host requests IP address: “DHCP request” msg  DHCP server sends address: “DHCP ack” msg

33

Special IP Addresses

 All 0’s IP address means: “This host”  Address with net.host = 0.host means:

 “host in this network”

 All 1’s IP address means:  “Broadcast on this network”  Address with net.host = net.111…1 means:

“broadcast on net”

 127.anything means “loopback”

slide-12
SLIDE 12

12

34

DHCP Client-Server Scenario

223.1.1.1 223.1.1.2 223.1.1.3 223.1.1.4 223.1.2.9 223.1.2.2 223.1.2.1 223.1.3.2 223.1.3.1 223.1.3.27

A B E

DHCP server arriving DHCP client needs address in this network

35

DHCP Client-Server Scenario

DHCP server: 223.1.2.5 arriving client

time DHCP discover src : 0.0.0.0, 68 dest.: 255.255.255.255,67 yiaddr: 0.0.0.0 transaction ID: 654 DHCP offer src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 654 Lifetime: 3600 secs DHCP request src: 0.0.0.0, 68 dest:: 255.255.255.255, 67 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs DHCP ACK src: 223.1.2.5, 67 dest: 255.255.255.255, 68 yiaddrr: 223.1.2.4 transaction ID: 655 Lifetime: 3600 secs

yiaddr: Your Internet address

36

NAT: Network Address Translation

NAT router Translates between local and global addresses available locally-unique IP addresses used host

Local IP address

Many locally unique addresses. A few globally unique addresses available.

INTERNET

Globally unique addresses must be used

slide-13
SLIDE 13

13

37

NAT Motivation

Local network uses just one IP address as far as

  • utside world is concerned

 No need to be allocated range of addresses from

ISP: - just one IP address is used for all devices

 Can change addresses of devices in local network

without notifying outside world

 Can change ISP without changing addresses of

devices in local network

 Devices inside local net not explicitly addressable,

visible by outside world (a security plus).

38

Functions of NAT Router

 Outgoing datagrams:

Replace (source IP address, port #) of every outgoing datagram to (NAT IP address, new port #) . . . remote clients/servers will respond using (NAT IP address, new port #) as destination addr.

 Remember (in NAT translation table)

every (source IP address, port #) to (NAT IP address, new port #) translation pair

 Incoming datagrams:

Replace (NAT IP address, new port #) in dest fields of every incoming datagram with corresponding (source IP address, port #) stored in NAT table

39

NAT: Network Address Translation

10.0.0.1 10.0.0.2 10.0.0.3 10.0.0.4 138.76.29.7

local network (e.g., home network) 10.0.0/24 rest of Internet

Datagrams with source or destination in this network have 10.0.0/24 address for source, destination (as usual) All datagrams leaving local network have same single source NAT IP address: 138.76.29.7, different source port numbers

slide-14
SLIDE 14

14

40

NAT Example

10.0.0.1 10.0.0.2 10.0.0.3

S: 10.0.0.1, 3345 D: 128.119.40.186, 80

1

10.0.0.4 138.76.29.7

1: host 10.0.0.1 sends datagram to 128.119.40, 80 NAT translation table WAN side addr LAN side addr 138.76.29.7, 5001 10.0.0.1, 3345 …… ……

S: 128.119.40.186, 80 D: 10.0.0.1, 3345

4

S: 138.76.29.7, 5001 D: 128.119.40.186, 80

2 2: NAT router changes datagram source addr from 10.0.0.1, 3345 to 138.76.29.7, 5001, updates table

S: 128.119.40.186, 80 D: 138.76.29.7, 5001

3 3: Reply arrives

  • dest. address:

138.76.29.7, 5001 4: NAT router changes datagram dest addr from 138.76.29.7, 5001 to 10.0.0.1, 3345

With NAT, the complete address of an entity is an IP address and a port number

41

NAT Issues

 16-bit port-number field:

 60,000 simultaneous connections with a single LAN-side

address!

 NAT mixes protocol layers at routers. [uses

information above layer 3]

 “Violates end-to-end argument”

 NAT possibility must be taken into account by

app designers, e.g., P2P applications

 Should address shortage be solved using

IPv6 instead? (a new address space of globally unique IDs) Many think so…

NAT Traversal Problem

 Client wants to connect to

server with address 10.0.0.1

 server address 10.0.0.1 local to

LAN (client can’t use it as destination addr)

 only one externally visible NATed

address: 138.76.29.7

 Solution 1:

statically configure NAT to forward incoming connection requests at given port to server

 e.g., (123.76.29.7, port 2500)

always forwarded to 10.0.0.1 port 25000

10.0.0.1 10.0.0.4 NAT router 138.76.29.7 Client ?

slide-15
SLIDE 15

15

 Solution 2: Universal Plug and

Play (UPnP) Internet Gateway Device (IGD) Protocol. Allows NATed host to:

v learn public IP address

(138.76.29.7)

v add/remove port

mappings (with lease times) i.e., automate static NAT port map configuration

10.0.0.1 10.0.0.4 NAT router 138.76.29.7 IGD

NAT Traversal Problem

 Solution 3: relaying (used in Skype)

 NATed client establishes connection to an

application relay

 External client connects to relay  Relay bridges packets between to connections 138.76.29.7 Client 10.0.0.1 NAT router

  • 1. connection to

relay initiated by NATed host

  • 2. connection to

relay initiated by client

  • 3. relaying

established

NAT Traversal Problem IPv6

 Initial motivation: 32-bit address space is

almost completely allocated.

 Additional features:

 Header format helps speed processing/

forwarding

 Header changes to facilitate QoS

IPv6 datagram format:

 Fixed-length 40-byte header  No fragmentation allowed

45

slide-16
SLIDE 16

16 IPv6 Header

Priority: identify priority among datagrams in flow Flow Label: identify datagrams in same “flow.” (concept of“flow” not well defined). Next header: identify upper-layer protocol for data

data destination address (128 bits) source address (128 bits) payload len next hdr hop limit flow label pri ver 32 bits

46

Other Changes from IPv4

 Checksum: removed entirely to reduce

processing time at each hop

 Options: allowed, but outside of header,

indicated by “Next Header” field

 ICMPv6: new version of ICMP

 additional message types, e.g. “Packet Too

Big”

 multicast group management functions

47

Transition From IPv4 To IPv6

 Not all routers can be upgraded

simultaneous

 no “flag days”  How will the network operate with mixed IPv4

and IPv6 routers?

 Tunneling: IPv6 carried as payload in IPv4

datagram among IPv4 routers

48