Chapter 3 TCP/IP Architecture Advance Features

81
TCP/IP Architecture Advanced Features 1 Chapter 3 TCP/IP Architecture Advance Features Some of these slides are copyrighted by: Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009. Departamento de Tecnología Electrónica

description

Chapter 3: Network Layer. Associated Protocols Chapter goals: understand congestion control in TCP understand advanced principles behind network layer services: address translation routing (path selection) network layer error control IPv4 address dynamic configuration Advanced topics: IPv6. TCP/IP Architecture Advanced Features 2

Transcript of Chapter 3 TCP/IP Architecture Advance Features

Page 1: Chapter 3 TCP/IP Architecture Advance Features

TCP/IP Architecture Advanced Features 1

Chapter 3TCP/IP Architecture Advance Features

Some of these slides are copyrighted by:

Computer Networking: A Top Down Approach 5th edition. Jim Kurose, Keith RossAddison-Wesley, April 2009.

Departamento deTecnología Electrónica

Page 2: Chapter 3 TCP/IP Architecture Advance Features

2

Chapter 3: Network Layer. Associated Protocols Chapter goals:

understand congestion control in TCP understand advanced principles behind

network layer services:• address translation • routing (path selection)• network layer error control• IPv4 address dynamic configuration• Advanced topics: IPv6.

TCP/IP Architecture Advanced Features

Page 3: Chapter 3 TCP/IP Architecture Advance Features

3

Chapter 2 outline 3.1 TCP congestion

control 3.2 Address

Translation: NAT 3.3 Routing in the

Internet RIP OSPF BGP

3.4 IPv4 error control: ICMP

3.5 IPv4 address dynamic configuration: DHCP

3.6 IP version 6

TCP/IP Architecture Advanced Features

Page 4: Chapter 3 TCP/IP Architecture Advance Features

4

Chapter 2 outline 3.1 TCP congestion

control 3.2 Address

Translation: NAT 3.3 Routing in the

Internet RIP OSPF BGP

3.4 IPv4 error control: ICMP

3.5 IPv4 address dynamic configuration: DHCP

3.6 IP version 6

TCP/IP Architecture Advanced Features

Page 5: Chapter 3 TCP/IP Architecture Advance Features

5

Principles of Congestion ControlCongestion: informally: “too many sources sending too

much data too fast for network to handle” different from flow control! manifestations:

lost packets (buffer overflow at routers) long delays (queuing in router buffers)

TCP/IP Architecture Advanced Features

Page 6: Chapter 3 TCP/IP Architecture Advance Features

6

Causes/costs of congestion Two tx:

IN = Sending rate OUT = Receiving

rate C= Router

capability

Queue theory

unlimited shared output link buffers

Host Ain : original data

Host B

out

large delays when congested

maximum achievable throughput

TCP/IP Architecture Advanced Features

Page 7: Chapter 3 TCP/IP Architecture Advance Features

7

Supposition: Tx retx lost packets Now, IN is not tx -> higher rate IN’ Congestion costs:

more work (retx) unneeded retransmissions: link carries multiple copies of pkt

Causes/costs of congestion:

unlimited shared output link buffers

Host Ain : original data

Host B

out

TCP/IP Architecture Advanced Features

Page 8: Chapter 3 TCP/IP Architecture Advance Features

8

Causes/costs of congestion Two tx and the same dest Supposition: congestion in the router between A and dest Another cost of congestion:

when a packet is dropped, any upstream transmission capacity used for that packet was wasted

finite shared output link buffers

Host Ain : original data

Host B

out

'in : original data, plus retransmitted data

TCP/IP Architecture Advanced Features

Page 9: Chapter 3 TCP/IP Architecture Advance Features

9

Causes/costs of congestion Congestion costs: a summary

Big delays when the incoming rate to a router is near to the link capability.

The tx must retx the lost segments due to the router overflow.

Unnecessary BW is used for the retx of duplicated copies of segments (due to delays).

Upstream transmission capacity used for a packet is wasted when it is discarded.

TCP/IP Architecture Advanced Features

Page 10: Chapter 3 TCP/IP Architecture Advance Features

10

Approaches towards congestion control

End-end congestion control:

no explicit feedback from network

congestion inferred from end-system observed loss, delay

approach taken by TCP

Network-assisted congestion control:

routers provide feedback to end systems E.g. single bit

indicating congestion

Two broad approaches towards congestion control:

TCP/IP Architecture Advanced Features

Page 11: Chapter 3 TCP/IP Architecture Advance Features

11

TCP Congestion Control sender limits

transmission:LastByteSent-LastByteAcked

CongWin How does sender

perceive congestion? loss event = timeout

or 3 duplicate acks TCP sender reduces

rate (CongWin) after loss event

Host A

timeo

ut

Host B

time

X

resend 2nd segment

Host ASeq=92, 8 bytes data

ACK=100

losstimeo

ut

lost ACK scenario

Host B

XSeq=92, 8 bytes data

ACK=100

timeResending a

segment after triple duplicate ACK

TCP/IP Architecture Advanced Features

Page 12: Chapter 3 TCP/IP Architecture Advance Features

12

TCP congestion control: additive increase, multiplicative decrease (AIMD)

8 Kbytes

16 Kbytes

24 Kbytes

time

congestionwindow

Approach: increase transmission rate (window size), probing for usable bandwidth, until loss occurs additive increase: increase CongWin by 1

MSS every RTT until loss detected multiplicative decrease: cut CongWin in half

after loss

timecong

estio

n w

indo

w s

ize

Saw toothbehavior: probing

for bandwidth

TCP/IP Architecture Advanced Features

Page 13: Chapter 3 TCP/IP Architecture Advance Features

13

TCP Congestion Control: details

Roughly,

When connection begins, CongWin = 1 MSS Example: MSS = 500 bytes & RTT =

200 ms initial rate = 20 kbps

three phases: slow start (SS) Congestion avoidance

(CA): e.g. AIMD Fast recovery (FR)

First two are compulsory in TCP, while the last one is recommendable

rate = CongWin

RTT Bytes/sec

TCP/IP Architecture Advanced Features

Page 14: Chapter 3 TCP/IP Architecture Advance Features

14

TCP Slow Start available bandwidth

may be >> MSS/RTT When connection

begins, increase rate exponentially fast until first loss event

initial rate is slow but ramps up exponentially fast

Host A

one segment

RTT

Host B

time

two segments

four segments

TCP/IP Architecture Advanced Features

Page 15: Chapter 3 TCP/IP Architecture Advance Features

15

Congestion avoidance After 3 dup ACKs:

CongWin is cut in half window then grows linearly

But after timeout event: CongWin instead set to 1 MSS; window then grows exponentially to a threshold, then grows linearly

3 dup ACKs indicates network capable of delivering some segments

timeout indicates a “more alarming” congestion scenario

Philosophy:

TCP/IP Architecture Advanced Features

Page 16: Chapter 3 TCP/IP Architecture Advance Features

Transport Layer Advanced Features 16

Summary: TCP Congestion Control When CongWin is below Threshold, sender in slow-start phase,

window grows exponentially. When CongWin is above Threshold, sender is in congestion-

avoidance phase, window grows linearly. When a triple duplicate ACK occurs, Threshold set to CongWin/2

and CongWin set to Threshold. When timeout occurs, Threshold set to CongWin/2 and CongWin is

set to 1 MSS.

Note: TCP version varies the way congestion control is applied. For example, TCP Tahoe always reduces Congestion Window to its initial value after a loss event. Meanwhile, in TCP Reno, all the congestion phases take place.

Page 17: Chapter 3 TCP/IP Architecture Advance Features

17

Chapter 2 outline 3.1 TCP congestion

control 3.2 Address

Translation: NAT 3.3 Routing in the

Internet RIP OSPF BGP

3.4 IPv4 error control: ICMP

3.5 IPv4 address dynamic configuration: DHCP

3.6 IP version 6

TCP/IP Architecture Advanced Features

Page 18: Chapter 3 TCP/IP Architecture Advance Features

18

Address Translation: NAT Problem: limited number of IP addr. Solutions

o Subnetting o Private IP addr

• 10.0.0.0/8• 172.16.0.0/12• 192.168.0.0/16• 169.254.0.0/16

TCP/IP Architecture Advanced Features

Page 19: Chapter 3 TCP/IP Architecture Advance Features

19

Address Translation: NAT Private IP addr: how can the dest know whose

is the private IP addr? Solution: NAT (Network Address Translation)

o Mechanism used to modify the IP addr inside pktso Allows private IP addr (inside networks)

communication with public IP addr (outside networks)

o NAT routers must keep a NAT table with translation in both directions

TCP/IP Architecture Advanced Features

Page 20: Chapter 3 TCP/IP Architecture Advance Features

20

NAT basic functioning NAT Router has one or more IP addr for NAT -> for translating private

IP into public IP NAT Router modifies “Source IP addr” field in the IP header & stores

matching public & pvt addr in the NAT Table Dest responds to modified addr NAT Router searches on its NAT Table & matches public & pvt addr,

sending the pkt to the pvt IP

NAT Router

Host A192.168.1.10

Host Z150.214.141.20

Inside network Outside network

192.168.1.1 150.214.141.1

192.168.1.10 150.214.141.20 150.214.141.2 150.214.141.20

IP packet IP packet

Source addr Dest addr Source addr Dest addr

150.214.141.20 150.214.141.2

IP packet

Source addr Dest addr

NAT Table

TCP/IP Architecture Advanced Features

Page 21: Chapter 3 TCP/IP Architecture Advance Features

21

Types of NAT Dynamic NAT Static NAT NAPT (Network Address Port Translation)

TCP/IP Architecture Advanced Features

Page 22: Chapter 3 TCP/IP Architecture Advance Features

22

Dynamic NAT Translation is unidirectional Traffic comes from the inside network Translation is temporary Once public IP addr is not in use, it is deleted from NAT Table

NAT Router

Host A192.168.1.10

Host Z150.214.141.20

Inside network Outside network

192.168.1.1 150.214.141.1

192.168.1.10 150.214.141.20 150.214.141.2 150.214.141.20

IP packet IP packet

Source addr Dest addr Source addr Dest addr

150.214.141.20 150.214.141.2

IP packet

Source addr Dest addr

NAT Table

150.214.141.20 150.214.141.2

IP packet

Source addr Dest addr

Private IP Public IP192.168.1.10 150.214.141.2

TCP/IP Architecture Advanced Features

Page 23: Chapter 3 TCP/IP Architecture Advance Features

23

Dynamic NAT

NAT Router

Host A192.168.1.10

Host Z150.214.141.20

Inside network Outside network

192.168.1.1 150.214.141.1

192.168.1.10 150.214.141.20 150.214.141.2 150.214.141.20

IP packet IP packet

Source addr Dest addr Source addr Dest addr

150.214.141.20 150.214.141.2

IP packet

Source addr Dest addr

NAT Table

150.214.141.20 150.214.141.2

IP packet

Source addr Dest addr

Private IP Public IP192.168.1.10 150.214.141.2

Advantage Saves public IP addr

Disadvantage Traffic always initiated from the inside network -> does not allow

servers

TCP/IP Architecture Advanced Features

Page 24: Chapter 3 TCP/IP Architecture Advance Features

24

Static NAT Translations are in the NAT Table since routers are configured Communication may be initiated by both the inside & the outside

networks Public IP addr must be known (via DNS) by the hosts in the outside

network

NAT Router

Host A192.168.1.10

Host Z150.214.141.20

Inside network Outside network

192.168.1.1 150.214.141.1

192.168.1.10 150.214.141.20 150.214.141.2 150.214.141.20

IP packet IP packet

Source addr Dest addr Source addr Dest addr

150.214.141.20 150.214.141.2

IP packet

Source addr Dest addr

NAT Table

150.214.141.20 150.214.141.2

IP packet

Source addr Dest addr

Private IP Public IP 192.168.1.10 150.214.141.2 static

TCP/IP Architecture Advanced Features

Page 25: Chapter 3 TCP/IP Architecture Advance Features

25

Static NAT Advantage

Allows servers Disadvantage

One public IP addr per pvt IP addr… but both dynamic & static NAT may be used together

NAT Router

Host A192.168.1.10

Host Z150.214.141.20

Inside network Outside network

192.168.1.1 150.214.141.1

192.168.1.10 150.214.141.20 150.214.141.2 150.214.141.20

IP packet IP packet

Source addr Dest addr Source addr Dest addr

150.214.141.20 150.214.141.2

IP packet

Source addr Dest addr

NAT Table

150.214.141.20 150.214.141.2

IP packet

Source addr Dest addr

Private IP Public IP 192.168.1.10 150.214.141.2 static

TCP/IP Architecture Advanced Features

Page 26: Chapter 3 TCP/IP Architecture Advance Features

26

NAPT Transport-Layer Port Identifiers are used Several pvt IP addr may be translated into a unique public IP

addr

NAPT Router

Host B192.168.1.12

Host Z150.214.141.20

Inside networkOutside network

192.168.1.1 150.214.141.1

192.168.1.11 1576 150.214.141.19 80

IP packet

Source addr Dest addr

NAPT Table

Private IP Public IP local 192.168.1.11:1576 global 150.214.141.2:1576 local 192.168.1.12:1576 global 150.214.141.2:1577

Host A192.168.1.11

Host Y150.214.141.19

Source port Dest port

150.214.141.2 1576 150.214.141.19 80

IP packet

Source addr Dest addrSource port Dest port

192.168.1.12 1576 150.214.141.20 21

IP packet

Source addr Dest addrSource port Dest port

150.214.141.2 1577 150.214.141.20 21

IP packet

Source addr Dest addrSource port Dest port

TCP/IP Architecture Advanced Features

Page 27: Chapter 3 TCP/IP Architecture Advance Features

27

About NAT Not every app work properly when going

through a NAT router (e.g, BOOTP) Difficult to follow the traffic that goes through

several NAT routers NAT increases router processing time NAPT is a type of NAT -> there are also dynamic

NAPT & static NAPT. Both may also be used together

TCP/IP Architecture Advanced Features

Page 28: Chapter 3 TCP/IP Architecture Advance Features

28

Chapter 2 outline 3.1 TCP congestion

control 3.2 Address

Translation: NAT 3.3 Routing in the

Internet RIP OSPF BGP

3.4 IPv4 error control: ICMP

3.5 IPv4 address dynamic configuration: DHCP

3.6 IP version 6

TCP/IP Architecture Advanced Features

Page 29: Chapter 3 TCP/IP Architecture Advance Features

29

Routing in the internet Network layer

functions Addressing Routing

Routing: finding the BEST route Best route depends

on different criteria: # of hops, transfer rate, load of a link, cost, reliability…

Different routes• Link breakage• Slow links

Which route?

TCP/IP Architecture Advanced Features

Page 30: Chapter 3 TCP/IP Architecture Advance Features

30

Routing in the internet

Two types of protocols IGP (Interior Gateway Protocols): define routing inside an

AS. (RIP, OSPF…) EGP (Exterior Gateway Protocols): define routing between

different AS.

Concept: Autonomous System (AS) AS: IP networks with a common routing

management

TCP/IP Architecture Advanced Features

Page 31: Chapter 3 TCP/IP Architecture Advance Features

31

Routing in the internetImportant concepts about routing: Virtual circuit vs datagrama Packet flow

Unicast Broadcast Multicast

Unicast routing algorithms Static Adaptive

• Centralized• Isolated• Distributed

TCP/IP Architecture Advanced Features

Page 32: Chapter 3 TCP/IP Architecture Advance Features

32

Routing in the internet Two approaches in routing

Virtual circuit• Route is established in

connection start Datagram

• Rcvr addr is inside every packet

Which route?

TCP/IP Architecture Advanced Features

Page 33: Chapter 3 TCP/IP Architecture Advance Features

33

Virtual circuit vs. Datagram Virtual circuit

Error & flow control; order maintenance

Connection oriented• Three phases:

establishment, transfer & termination

Advantages• Efficiency• QoS

Datagram Each packet is an

independent unit• Dest addr in every

packet• Packets may arrive

disordered to dest• No error or flow control

Advantages• More simple• No connection -> better

for short-time tx• More reliable• Better for heterogeneous

networks TCP/IP Architecture Advanced Features

Page 34: Chapter 3 TCP/IP Architecture Advance Features

34

Packet flow Unicast Broadcast Multicast

TCP/IP Architecture Advanced Features

Page 35: Chapter 3 TCP/IP Architecture Advance Features

35

A

B

C D E F

4 flows

2 flows

Unicast Individual flows: one tx, one rx

TCP/IP Architecture Advanced Features

Page 36: Chapter 3 TCP/IP Architecture Advance Features

36

Broadcast one tx, everyone rx

A

B

C D E F

1 flow

1 flow

TCP/IP Architecture Advanced Features

Page 37: Chapter 3 TCP/IP Architecture Advance Features

37

Multicast one flow, only desired rx

A

B

C D E F

1 flow

1 flow

TCP/IP Architecture Advanced Features

Page 38: Chapter 3 TCP/IP Architecture Advance Features

38

Unicast routing Objective

Carry pkts from sender to receiver

Network-layer routing Hierarchic addressing:

first finds network & the host

Routing algorithm Router calculates the

way of routing

Routing algorithm features Correct Simple Robust Fair Optimum

TCP/IP Architecture Advanced Features

Page 39: Chapter 3 TCP/IP Architecture Advance Features

39

Routing algorithms Router

Network device that interconnects networks & implements routing algorithm

Routing algorithm decides which interface is correct

RouterInput gateways

Outputgateways

RoutingTable

Routing Engine

TCP/IP Architecture Advanced Features

Page 40: Chapter 3 TCP/IP Architecture Advance Features

40

Routing algorithms Classification

Static routing Adaptive routing

• Centralized• Isolated• Distributed: most used on the internet (RIP/OSPF)

TCP/IP Architecture Advanced Features

Page 41: Chapter 3 TCP/IP Architecture Advance Features

41

Static Routing Does not consider current network condition Routes are determined before starting network

service

Advantages Simple Good results for constant traffic and network topology

Disadvantages Not suitable for networks with changing topology Not suitable for big networks -> not scalable

TCP/IP Architecture Advanced Features

Page 42: Chapter 3 TCP/IP Architecture Advance Features

42

Adaptive Routing Decisions based on

Current topology Network condition (congested links)

Better than static routing but more difficult to implement

Three subgroups Centralized Adaptive Routing Isolated Adaptive Routing Distributed Adaptive Routing

TCP/IP Architecture Advanced Features

Page 43: Chapter 3 TCP/IP Architecture Advance Features

43

Centralized Adaptive Routing Routing Control Center (RCC) Nodes (routers) send info about their condition to RCC

List of neighbour nodes Queue length Use of links

RCC Receives the information Calculates optimum route for every two nodes Calculates routing table for every node Distributes tables to nodes

Disadvantages RCC & links to RCC -> bottlenecks Inaccurate calculation

TCP/IP Architecture Advanced Features

Page 44: Chapter 3 TCP/IP Architecture Advance Features

44

Isolated Adaptive Routing No info interchange between nodes Decisions based only on local info -> simple Example

Flooding

TCP/IP Architecture Advanced Features

Page 45: Chapter 3 TCP/IP Architecture Advance Features

45

Distributed Adaptive Routing Used on the internet Two subgroups

Distance vector algorithms• Decisions based on the information received from neighbour

nodes• E.g. RIP (Routing Information Protocol)

Link state algorithms• All the nodes know the state of the network• Some time to propagate changes• E.g. OSPF (Open Shortest Path First)

TCP/IP Architecture Advanced Features

Page 46: Chapter 3 TCP/IP Architecture Advance Features

46

RIP: Routing Information Protocol Routing Information Protocol

(RIP) – RFC 1058 (RIP), RFC 1723 (RIPv2):

Routing Protocol (application-layer protocol over UDP – port 520 -)

Used for interior routing inside an AS

RIPv2 is identical to RIP, but with two extensions: Allows CIDR Authentication mechanism

Metric: hop counts Maximum number of hops

-> 15 Better for homogeneous

networks Routing table distance

vector-based Routing table updates:

Periodic updates: via broadcast (in RIPv2: multicast to 224.0.0.9)

Updates when network topology changes

TCP/IP Architecture Advanced Features

Page 47: Chapter 3 TCP/IP Architecture Advance Features

47

RIP: Routing Information ProtocolRIP functioning

Update from neighbour N arrives to a router R: Networks known by N, and not by R, are included in R’s

routing table. If N knows a better route for a network known by both, R’s

routing table is updated Metric (# of hops) is increased by one Router R publishes information increasing in one unit what it

is introduced in its routing table. Update messages tx to neighbours. Two ways

• Not using split horizon technique: Updates are sent to all the neighbours.

• Using split horizon technique. Updates sent to all the neighbours, except to those who informed about the best route.

TCP/IP Architecture Advanced Features

Page 48: Chapter 3 TCP/IP Architecture Advance Features

48

RIP: Routing Information ProtocolRIP timers

Routing-update timer: 30 seconds – random time

Route-timeout timer: after timeout -> invalid route

Route-flush timer: after timeout -> deletes route from enrouting table

TCP/IP Architecture Advanced Features

Page 49: Chapter 3 TCP/IP Architecture Advance Features

49

RIP: Routing Information ProtocolRIP message Command

Request (1) Response (2): most common (updates)

Version: v1 or v2 RIP version 2: most important field -> subnet mask ->

allows CIDR (subnetting)

TCP/IP Architecture Advanced Features

Page 50: Chapter 3 TCP/IP Architecture Advance Features

50

OSPF: Open Shortest Path FirstOpen Shortest Path First (OSPF)

Used for interior routing inside an AS Larger networks than RIP (usually) Open protocol (RFC 2328)

TCP/IP Architecture Advanced Features

Page 51: Chapter 3 TCP/IP Architecture Advance Features

51

OSPF: Basic FoundationsOpen Shortest Path First

(OSPF)

Link state routing protocol Dijkstra algorithm to find the

BEST route A router builds a graph Graph weights are configured

by the network administrator All equal to 1 (similar to RIP) Inversely proportional to BW

(usual criterium) Any criteria may be fixed

Open Shortest Path First (OSPF)

Updates disseminated to entire AS (via flooding)

Changes in topology Periodically (once every 30

min, at least) carried in OSPF messages

directly over IP (rather than TCP or UDP) -> protocol field: 89

Link connectivity is checked by HELLO msgs for neighbours

TCP/IP Architecture Advanced Features

Page 52: Chapter 3 TCP/IP Architecture Advance Features

52

OSPF advanced features (not in RIP)

security: all OSPF messages authenticated For each link, multiple cost metrics for different

TOS hierarchical OSPF in large domains.

TCP/IP Architecture Advanced Features

Page 53: Chapter 3 TCP/IP Architecture Advance Features

53

OSPF header

Checksum: error control

Authentication

Value

Type

1 HELLO2 Database description3 Link state request4 Link state update5 Link state ACK

TCP/IP Architecture Advanced Features

Page 54: Chapter 3 TCP/IP Architecture Advance Features

54

BGP: Border Gateway Protocol

Problem: Different IP networks do not have to use same routing protocol

Two types of protocols IGP (Interior Gateway Protocols): define routing inside an

AS. (RIP, OSPF…) EGP (Exterior Gateway Protocols): define routing

between different AS. BGP (Border Gateway Protocol): most common

EGP (RFC 4271)

TCP/IP Architecture Advanced Features

Page 55: Chapter 3 TCP/IP Architecture Advance Features

55

BGP: Main features

BGP provides each AS means to:1. Obtain subnet reachability information from

neighboring ASs.2. Propagate reachability information to all AS-

internal routers. allows subnet to advertise its existence

to rest of Internet

TCP/IP Architecture Advanced Features

Page 56: Chapter 3 TCP/IP Architecture Advance Features

56

BGP: Main features Every AS: ASN = Autonomous System

Number) Inside every AS -> AS routing protocol Outside AS -> “border router”: border

routers in different AS exchange their routing tables

BGP works over TCP (port 179)

TCP/IP Architecture Advanced Features

Page 57: Chapter 3 TCP/IP Architecture Advance Features

57

BGP: Example

TCP/IP Architecture Advanced Features

Page 58: Chapter 3 TCP/IP Architecture Advance Features

58

Chapter 2 outline 3.1 TCP congestion

control 3.2 Address

Translation: NAT 3.3 Routing in the

Internet RIP OSPF BGP

3.4 IPv4 error control: ICMP

3.5 IPv4 address dynamic configuration: DHCP

3.6 IP version 6

TCP/IP Architecture Advanced Features

Page 59: Chapter 3 TCP/IP Architecture Advance Features

59

ICMP: Internet Control Message Protocol

used by hosts & routers to communicate network-level information error reporting:

unreachable host, network, port, protocol

warnings from routers or receivers

network-layer above IP: ICMP msgs carried in

IP datagrams (but ICMP is not a transport-layer protocol!)

all the nodes using IP must have ICMP implemented

ICMP msgs are only created for the first IP fragment

TCP/IP Architecture Advanced Features

Page 60: Chapter 3 TCP/IP Architecture Advance Features

60

ICMP: Internet Control Message Protocol Message format

ICMP msgs carried in IP datagrams

• Protocol field = 1 in IP header

• Source IP addr = host sending ICMP msg

Type Code description0 0 echo reply (ping)3 0 dest. network unreachable3 1 dest host unreachable3 2 dest protocol unreachable3 3 dest port unreachable5 0 ICMP redirect8 0 echo request (ping)11 0 TTL expired

TCP/IP Architecture Advanced Features

Page 61: Chapter 3 TCP/IP Architecture Advance Features

61

ICMP: Internet Control Message Protocol Ping

Sends data pkt and waits for a response Based on Type 8 and Type 0 ICMP messages Functions:

• Check host connectivity• Ping sends pkts with unique seq numbers

– Detection ofduplicate, reordered and eliminated pkts • Ping use cheksums in every pkt

– Detection of corrupted pkts• Ping allows RTT (Round Trip Time) calculation• Ping allows the detection of other ICMP messages.

TCP/IP Architecture Advanced Features

Page 62: Chapter 3 TCP/IP Architecture Advance Features

62

ICMP: Internet Control Message Protocol Ping

Echo request and echo reply

1 byte 1 byte 2 bytes +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Code | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Id | Sequence number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Type: 8 (Echo request) or 0 (Echo reply)Code: 0Id: number of identificación (optional)Sequence number (optional)

TCP/IP Architecture Advanced Features

Page 63: Chapter 3 TCP/IP Architecture Advance Features

63

ICMP: Internet Control Message Protocol Ping

Syntax ping [options] destination_host

Options -w timeout Timeout in milliseconds to wait for each reply. -i TTL Time To Live.-v TOS Type Of Service. -a Resolve addresses to hostnames. -n count Number of echo requests to send. -t Ping the destination host until interrupted. To see statistics and continue type Control-Break; To stop type Control-C. -l size Send buffer size. -f Set Don't Fragment flag in packet (IPv4-only). -r count Record route for count hops (IPv4-only). -s count Timestamp for count hops (IPv4-only). -j host_list Loose source route along host_list (IPv4-only). -k host_list Strict source route along host_list (IPv4-only). destination_host The name of the remote host -R Use routing header to test reverse route also (IPv6-only). -S srcaddr Source address to use (IPv6-only). -4 Force using IPv4. -6 Force using IPv6

TCP/IP Architecture Advanced Features

Page 64: Chapter 3 TCP/IP Architecture Advance Features

64

ICMP: Internet Control Message Protocol Tracert (Trace route)

Source sends echo requests to dest

• First has TTL =1• Second has TTL=2, etc.

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

Tracert does this 3 times per router

Stopping criterion Echo request eventually

arrives at destination host

Destination returns echo reply

When source gets this ICMP, stops.

TCP/IP Architecture Advanced Features

Page 65: Chapter 3 TCP/IP Architecture Advance Features

65

ICMP: Internet Control Message Protocol Tracert (Trace route)

Echo requestTTL = 1

Echo requestTTL = 1

Echo requestTTL = 1

Echo requestTTL = 1

Echo requestTTL = 2

Echo requestTTL = 2

Echo requestTTL = 2

Echo requestTTL = 3

Echo requestTTL = 4

Echo requestTTL = 3

ICMP messageTTL exceeded (type 11)

ICMP messageTTL exceeded (type 11) ICMP message

TTL exceeded (type 11)

Echo reply

X X

X

TCP/IP Architecture Advanced Features

Page 66: Chapter 3 TCP/IP Architecture Advance Features

66

ICMP: Internet Control Message Protocol Destination unreachable (type 3)

Most usual code values (causes)• Code 1: host unreachable• Code 3: port unreachable• Code 4: fragmentation needed

TCP/IP Architecture Advanced Features

Page 67: Chapter 3 TCP/IP Architecture Advance Features

67

ICMP: Internet Control Message Protocol

NETWORK B

NETWORK A

Router A

Router B

(1)

(3)

(2)

ICMP Redirect (type 5)

useful when there are some possible

gateways Steps Packet is sent to default

gateway Default gateway sends

packet to router B Default gateway sends

ICMP redirect to host

TCP/IP Architecture Advanced Features

Page 68: Chapter 3 TCP/IP Architecture Advance Features

68

Chapter 2 outline 3.1 TCP congestion

control 3.2 Address

Translation: NAT 3.3 Routing in the

Internet RIP OSPF BGP

3.4 IPv4 error control: ICMP

3.5 IPv4 address dynamic configuration: DHCP

3.6 IP version 6

TCP/IP Architecture Advanced Features

Page 69: Chapter 3 TCP/IP Architecture Advance Features

69

Dynamic Address Configuration Address configuration

static dynamic: automatic and more efficient

Dynamic Address Configuration Protocols RARP: Reverse Address Resolution

Protocol BootP: Bootstrap Protocol DHCP: Dynamic Host Configuration

Protocol

TCP/IP Architecture Advanced Features

Page 70: Chapter 3 TCP/IP Architecture Advance Features

70

Dynamic Address Configuration RARP

RARP: Reverse Address Resolution Protocol

Given a MAC, an IP address is assigned Messages have the same structure as ARP

ones RARP is limited and, thus, obsolete.

TCP/IP Architecture Advanced Features

Page 71: Chapter 3 TCP/IP Architecture Advance Features

71

Dynamic Address Configuration BootP

BootP Protocol: Bootstrap Protocol

Used to obtain IP automatically (generally in boot process)

Not usually utilized for Dynamic Address Configuration, as DHCP is an improved version of BootP.

BootP process Host determines its own

MAC Host sends its IP to

server’s port 67 (0.0.0.0 if doesn’t know its IP and 255.255.255.255 if doesn’t’ know the server’s one)

Server searches host’s MAC in a configuration file

Server fills server’s and host’s IPs in UDP datagram and sends it to client’s port 68

Host saves its IP and bootsTCP/IP Architecture Advanced Features

Page 72: Chapter 3 TCP/IP Architecture Advance Features

72

Dynamic Address Configuration BootP message

Code: BootPRequest & BootPReply

Transaction id HW address: e.g. MAC Server host name (server does

not need to be in the same broadcast domain)

Boot file name Vendor specific area

• Magic cookie: shows the kind of optional info below

• A critical field for DHCP

TCP/IP Architecture Advanced Features

Page 73: Chapter 3 TCP/IP Architecture Advance Features

73

Dynamic Address Configuration DHCPDynamic Host Configuration Protocol (DHCP) – RFC 2131:

Capable of automatically assign reusable (IP address leasing) Based on BootP, standardizing Vendor Specific Area field in BootP PDU

(312 bytes). 3 mechanisms for the assignment of IP addresses:

• Automatic assignment:– DHCP assigns a permanent IP address to the host.

• Dynamic assigment:– DHCP assigns an IP address for a limited period of time -> automatic reuse of non-

neccessary IP addresses• Static assignment:

– IP address assigned by network administrator

TCP/IP Architecture Advanced Features

Page 74: Chapter 3 TCP/IP Architecture Advance Features

74

Dynamic Address Configuration DHCP message

Same as BootP message except options field (312 bytes) instead of Vendor Specific Area

• First four bytes: magic cookie -> 99.130.83.99 (means DHCP).

• Different options. Most important below

– 50: requested IP address– 51: IP address lease time– 53: type of DHCP message

TCP/IP Architecture Advanced Features

Page 75: Chapter 3 TCP/IP Architecture Advance Features

75

Dynamic Address Configuration DHCP cycle

1. DHCP DISCOVER: tries to find a DHCP Server.

2. DHCP OFFER: the server/s offers an IP address

3. DHCP REQUEST: the client requests some parameters (generally the ones oferred by the server)

4. DHCP ACK: server ACK

Besides:

• DHCP RELEASE: releases IP address

• DHCP DECLINE. The offered IP is in use

• DHCP INFORM: requests some configuration parameters

• DHCP NAK: if server does not accept request

1

2

3

4DHCP Client(port 68) DHCP Server

(port 67)

TCP/IP Architecture Advanced Features

Note: Basic cycle is executed if an IP address is not available. Other way, only half the cycle take place.

Page 76: Chapter 3 TCP/IP Architecture Advance Features

76

Dynamic Address Configuration Other DHCP features

A router may be a DHCP server BootP Relay: when the server is not in the same client’s

broadcast domain Gratuitous ARP: ARP request by the client of its own IP. Checks

if the assigned IP is busy. Option 50: client requests a fixed IP Option 51: IP address lease time Maximum DHCP message size: 576 bytes

TCP/IP Architecture Advanced Features

Page 77: Chapter 3 TCP/IP Architecture Advance Features

77

Chapter 2 outline 3.1 TCP congestion

control 3.2 Address

Translation: NAT 3.3 Routing in the

Internet RIP OSPF BGP

3.4 IPv4 error control: ICMP

3.5 IPv4 address dynamic configuration: DHCP

3.6 IP version 6

TCP/IP Architecture Advanced Features

Page 78: Chapter 3 TCP/IP Architecture Advance Features

78

IPv6 Initial motivation: 32-bit address space

completely allocated. Basic changes:

128-bit address space• E.g: 2002:96d6:8ddc::96dc:6301 (the bits remaining

are zeros) header format helps speed

processing/forwarding 40-byte header (fixed size) Other changes based on previous experience

on IPv4

TCP/IP Architecture Advanced Features

Page 79: Chapter 3 TCP/IP Architecture Advance Features

79

IPv6 headerVersion: 6Priority: identify priority among datagrams in flowFlow Label: identify datagrams in same “flow.” (concept of“flow” not well defined).Payload length: data field length

Next header: identify upper layer protocol for data Hop limit: analog to IPv4 TTL fieldSrc & Dest addr: 128 bytes

TCP/IP Architecture Advanced Features

Page 80: Chapter 3 TCP/IP Architecture Advance Features

80

Changes from IPv4 Checksum: removed entirely to reduce

processing time at each hop Fragmentation: removed from IPv6, also

to reduce processing time Options: allowed, but outside of header,

indicated by “Next Header” field ICMPv6: new version of ICMP

additional message types, e.g. “Packet Too Big”

TCP/IP Architecture Advanced Features

Page 81: Chapter 3 TCP/IP Architecture Advance Features

81

Transition from IPv4 to IPv6 Not all routers can be upgraded

simultaneous no D Day How does the internet operate with mixed IPv4

and IPv6 routers? Tunneling: IPv6 carried as payload in IPv4

datagram among IPv4 routers

TCP/IP Architecture Advanced Features