1 IP Addressing: introduction IP networks 223.1.1.1 223.1.1.1 IP - - PDF document

1
SMART_READER_LITE
LIVE PREVIEW

1 IP Addressing: introduction IP networks 223.1.1.1 223.1.1.1 IP - - PDF document

IP overview Internet Protocol Service model Addressing Forwarding (Routing later) 9/29/06 CS/ECE 438 - UIUC, Fall 2006 1 9/29/06 CS/ECE 438 - UIUC, Fall 2006 2 Layer reminder IP service model Bridges - emulate single link


slide-1
SLIDE 1

1

9/29/06 CS/ECE 438 - UIUC, Fall 2006 1

Internet Protocol

9/29/06 CS/ECE 438 - UIUC, Fall 2006 2

IP overview

 Service model  Addressing  Forwarding (Routing later)

9/29/06 CS/ECE 438 - UIUC, Fall 2006 3

Layer reminder

 Bridges - emulate single link

Everything broadcast

Same collision domain

 Switches - emulate single network

Flat addressing

Broadcast supported

 Internet - connect multiple networks

Hierarchical addressing

No broadcast

Highly scalable

9/29/06 CS/ECE 438 - UIUC, Fall 2006 4

IP service model

Service provided to transport layer (TCP, UDP)

Global name space

Host-to-host connectivity (connectionless)

Best-effort packet delivery

Not in IP service model

Delivery guarantees on bandwidth, delay or loss

Delivery failure modes

Packet delayed for a very long time

Packet loss

Packet delivered more than once

Packets delivered out of order

9/29/06 CS/ECE 438 - UIUC, Fall 2006 5

IP comparison with ATM

no no yes no none UBR ATM yes no yes no guarantee d minimum ABR ATM no congestion yes yes yes guarantee d rate VBR ATM no congestion yes yes yes constant CBR ATM no no no no none best effort Internet Timing Order Loss Bandwidth Congestion Feedback Guarantees Service Model Network Architecture

9/29/06 CS/ECE 438 - UIUC, Fall 2006 6

IP addressing

 Ethernet address space

 Flat  Assigned at manufacture time

 IP address space

 Hierarchical  Assigned at configuration time

slide-2
SLIDE 2

2

9/29/06 CS/ECE 438 - UIUC, Fall 2006 7

IP Addressing: introduction

IP address: 32-bit identifier for host, router interface

interface: connection between host/router and physical link

routers typically have multiple interfaces

host typically has one interface

IP addresses associated with each interface

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 223.1.1.1 = 11011111 00000001 00000001 00000001 223 1 1 1

9/29/06 CS/ECE 438 - UIUC, Fall 2006 8

IP networks

Address has 2 components

Network (high-order bits)

Host (low-order bits)

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

9/29/06 CS/ECE 438 - UIUC, Fall 2006 9

IPv4 Address Model

IP Multicast Future Use E 1110 + Multicast Address D 221 256 - 2 8 bit 110 + 21 bit C 214 65,536 - 2 16 bit 10 + 14 bit B 126 224-2 24 bit 0 + 7 bit A # of Networks # of Addresses Host ID Network ID Class

0 Network (7 bits) Network (14 bits) 1 1 0 1 0 Network (21 bits) Host (24 bits) Host (16 bits) Host (8 bits) Class A: Class B: Class C:

9/29/06 CS/ECE 438 - UIUC, Fall 2006 10

IP networks

 Class A network: 18.0.0.0 (MIT)

www.mit.edu has address 18.7.22.83

 Class B network: 128.174.0.0 (UIUC)

www.cs.uiuc.edu has address 128.174.252.84

 Class C network: 216.125.249.0 (Parkland)

www.parkland.edu has address 216.125.249.97

9/29/06 CS/ECE 438 - UIUC, Fall 2006 11

CIDR

 3-class model too inflexible  CIDR: Classless InterDomain Routing

 Arbitrary number of bits to specify

network

 Address format: a.b.c.d/x, where x is #

bits in network portion

11001000 00010111 00010000 00000000

subnet part host part

200.23.16.0/23

9/29/06 CS/ECE 438 - UIUC, Fall 2006 12

Classless Domains

 Internet Archive - 207.241.224.0/20

4K hosts

207.241.224.0 - 207.241.239.255

 AT&T - 204.127.128.0/18

16K hosts

204.127.128.0 - 204.127.191.255

 UUNET - 63.64.0.0/10

4M hosts

63.64.0.0 - 63.127.255.255

slide-3
SLIDE 3

3

9/29/06 CS/ECE 438 - UIUC, Fall 2006 13

IP forwarding

 Forwarding table has:

 Network number  Interface

 Avoid having to store 4 billion entries

 But there are still 2 million class C’s  …and perhaps more CIDR networks

9/29/06 CS/ECE 438 - UIUC, Fall 2006 14

Hierarchical Networks

“Send me anything with addresses beginning 200.23.16.0/20”

200.23.16.0/23 200.23.18.0/23 200.23.30.0/23

Fly-By-Night-ISP Organization 0 Organization 7 Internet Organization 1 ISPs-R-Us “Send me anything with addresses beginning 199.31.0.0/16”

200.23.20.0/23

Organization 2

. . . . . .

9/29/06 CS/ECE 438 - UIUC, Fall 2006 15

Subnetting

 UIUC - 130.126.0.0/16

 130.126.0.0 - 130.126.255.255

 CRHC - 130.126.136.0/21

 130.126.136.0 - 130.126.143.255

 EWS - 130.126.160.0/21

 130.126.160.0 - 130.126.167.255

9/29/06 CS/ECE 438 - UIUC, Fall 2006 16

Forwarding Tables

130.126.136.0/21 if1 130.126.160.0/21 if2 130.126.0.0/16 if3 0.0.0.0/0 if4

 Most specific rule is used  Most hosts outside of the core have

default rules

CRHC EWS UIUC Internet

if1 if2 if4 if3

9/29/06 CS/ECE 438 - UIUC, Fall 2006 17

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

9/29/06 CS/ECE 438 - UIUC, Fall 2006 18

NAT: Network Address Translation

Motivation: local network uses just one IP address as far as outside world is concerned:

range of addresses not needed from ISP: just one IP address 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).

slide-4
SLIDE 4

4

9/29/06 CS/ECE 438 - UIUC, Fall 2006 19

NAT: Network Address Translation

Implementation: NAT router must:

 outgoing datagrams: replace (source IP address, port #)

  • f 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

9/29/06 CS/ECE 438 - UIUC, Fall 2006 20

NAT: Network Address Translation

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.186, 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

9/29/06 CS/ECE 438 - UIUC, Fall 2006 21

NAT: Network Address Translation

 16-bit port-number field:

60K simultaneous connections with a single LAN-side address!

 NAT is controversial:

routers should only process up to layer 3

violates end-to-end argument

NAT possibility must be taken into account by app designers, eg, P2P applications

address shortage should instead be solved by IPv6

9/29/06 CS/ECE 438 - UIUC, Fall 2006 22

IPv4 Address Translation support

 IP addresses to LAN physical addresses  Problem

An IP route can pass through many physical networks

Data must be delivered to destination’s physical network

Hosts only listen for packets marked with physical interface names

Each hop along route

Destination host

9/29/06 CS/ECE 438 - UIUC, Fall 2006 23

IP to Physical Address Translation

 Hard-coded

Encode physical address in IP address

Ex: Map Ethernet addresses to IP addresses

Makes it impossible to associate address with topology  Fixed table

Maintain a central repository and distribute to hosts

Bottleneck for queries and updates  Automatically generated table

Use ARP to build table at each host

Use timeouts to clean up table

9/29/06 CS/ECE 438 - UIUC, Fall 2006 24

ARP

Check table for physical address

If address not present

Broadcast a query, include host’s translation

Wait for a response

Upon receipt of ARP query/response

Targeted host responds with address translation

If address already present

Refresh entry and reset timeout

If address not present

Add entry for requesting host

Ignore for other hosts 

Timeout and discard entries after O(10) minutes

slide-5
SLIDE 5

5

9/29/06 CS/ECE 438 - UIUC, Fall 2006 25

ARP Packet

TargetHardwareAddr (bytes 2 – 5) TargetProtocolAddr (bytes 0 – 3) SourceProtocolAddr (bytes 2 – 3) Hardware type = 1 ProtocolType = 0x0800 SourceHardwareAddr (bytes 4 – 5) TargetHardwareAddr (bytes 0 – 1) SourceProtocolAddr (bytes 0 – 1) HLEN = 48 PLEN = 32 Operation SourceHardwareAddr (bytes 0 – 3)

8 16 31

9/29/06 CS/ECE 438 - UIUC, Fall 2006 26

IP Packet Format

Version

HLen TOS Length Ident Flags Offset TTL Protocol Checksum SourceAddr DestinationAddr Options (variable) Pad

(variable)

4 8 16 19 31 Data

9/29/06 CS/ECE 438 - UIUC, Fall 2006 27

IP Packet Format

 4-bit version

 IPv4 = 4, IPv6 = 6

 4-bit header length

 Counted in words, minimum of 5

 8-bit type of service field (TOS)

 Mostly unused

 16-bit data length

 Counted in bytes

9/29/06 CS/ECE 438 - UIUC, Fall 2006 28

IP Packet Format

 Fragmentation support

16-bit packet ID

All fragments from the same packet have the same ID

3-bit flags

1-bit to mark last fragment

13-bit fragment offset into packet

Counted in 8-byte words  8-bit time-to-live field (TTL)

Hop count decremented at each router

Packet is discard if TTL = 0

9/29/06 CS/ECE 438 - UIUC, Fall 2006 29

IP Packet Format

8-bit protocol field

TCP = 6, UDP = 17

16-bit IP checksum on header

32-bit source IP address

32-bit destination IP address

Options

Variable size

Source-based routing

Record route

Padding

Fill to 32-bit boundaries

9/29/06 CS/ECE 438 - UIUC, Fall 2006 30

IP Packet Size

 Problem

 Different physical layers provide different

limits on frame length

Maximum transmission unit (MTU)

 Source host does not know minimum

value

Especially along dynamic routes

slide-6
SLIDE 6

6

9/29/06 CS/ECE 438 - UIUC, Fall 2006 31

IP Fragmentation and Reassembly

 Solution

 When necessary, split IP packet into

acceptably sized packets prior to sending

  • ver physical link

 Questions 

Where should reassembly occur?

What happens when a fragment is damaged/lost?

9/29/06 CS/ECE 438 - UIUC, Fall 2006 32

IP Fragmentation and Reassembly

 Fragments are self-contained IP datagrams  Reassemble at destination to minimize

refragmentation

 Drop all fragments in packet if one or more

fragments are lost

 Avoid fragmentation at source host

Transport layer should send packets small enough to fit into one MTU of local physical network

Must consider IP header

Note: MTU in ATM is based on CS-PDU size

9/29/06 CS/ECE 438 - UIUC, Fall 2006 33

IP Fragmentation and Reassembly

ETH IP (1400) FDDI IP (1400) PPP IP (376) PPP IP (512) PPP IP (512) ETH IP (376) ETH IP (512) ETH IP (512) Start of header Ident = x Offset 0 Rest of header 1400 data bytes Start of header Ident = x 1 Offset 0 Rest of header 512 data bytes Start of header Ident = x 1 Offset 512 Rest of header 512 data bytes Start of header Ident = x Offset 1024 Rest of header 376 data bytes H1 R1 R2 R3 H2 ETH FDDI PPP ETH

9/29/06 CS/ECE 438 - UIUC, Fall 2006 34

Internet Control Message Protocol (ICMP)

 IP companion protocol

 Handles error and control messages Modem ATM FDDI Ethernet FTP TFTP NV HTTP TCP UDP IP ICMP

9/29/06 CS/ECE 438 - UIUC, Fall 2006 35

ICMP

 Error Messages

Host unreachable

Reassembly failed

IP checksum failed

TTL exceeded (packet dropped)

Invalid header

 Control Messages

Echo/ping request and reply

Echo/ping request and reply with timestamps

Route redirect

9/29/06 CS/ECE 438 - UIUC, Fall 2006 36

Traceroute and ICMP

Source sends series of UDP segments to dest

 First has TTL =1  Second has TTL=2, etc.  Unlikely port number 

When nth datagram arrives to nth router:

 Router discards datagram  And sends to source an

ICMP message (type 11, code 0)

 Message includes name of

router& IP address

When ICMP message arrives, source calculates RTT

Traceroute does this 3 times Stopping criterion

UDP segment eventually arrives at destination host

Destination returns ICMP “host unreachable” packet (type 3, code 3)

When source gets this ICMP, stops.

slide-7
SLIDE 7

7

9/29/06 CS/ECE 438 - UIUC, Fall 2006 37

Host Configuration

 Plug new host into network

How much information must be known?

What new information must be assigned?

How can process be automated?

 Some answers

Host needs an IP address (must know it)

Host must also

Send packets out of physical (direct) network

Thus needs physical address of router

9/29/06 CS/ECE 438 - UIUC, Fall 2006 38

Host Configuration

Reverse Address Resolution Protocol (RARP)

Translate physical address to IP address

Used to boot diskless hosts

Host broadcasts request to boot

RARP server tells host the host’s own IP address

Boot protocol (BOOTP)

Use UDP packets for same purpose as RARP

Allows boot requests to traverse routers

IP address of BOOTP server must be known

Also returns file server IP, subnet mask, and default router for host

9/29/06 CS/ECE 438 - UIUC, Fall 2006 39

Dynamic Host Configuration Protocol (DHCP)

 A simple way to automate

configuration information

 Network administrator does not need to

enter host IP address by hand

 Good for large and/or dynamic networks

9/29/06 CS/ECE 438 - UIUC, Fall 2006 40

Dynamic Host Configuration Protocol (DHCP)

New machine sends request to DHCP server for assignment and information

Server receives

Directly if new machine given server’s IP address

Through broadcast if on same physical network

Via DHCP relay nodes that forward requests onto the server’s physical network

Server assigns IP address and provides other info

Can be made secure (present signed request or just a “valid” physical address)

9/29/06 CS/ECE 438 - UIUC, Fall 2006 41

DHCP

DHCP Server Host A Host A broadcasts DHCPDISCOVER message Host A broadcasts DHCP request Host B DHCP Server DHCP Relay Other Networks Other Networks Relay unicasts DHCP request to server Server responds with host’s IP address