81
TCP/IP Architecture Advanced Features 1 Chapter 3 TCP/IP Architecture Advanced 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

TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

Embed Size (px)

Citation preview

Page 1: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

TCP/IP Architecture Advanced Features 1

Chapter 3TCP/IP Architecture Advanced 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: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

2

Chapter 3: Network Layer. Associated Protocols Chapter goals:

understanding advanced principles behind network layer services:

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

understanding congestion control in TCP

TCP/IP Architecture Advanced Features

Page 3: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

3

Chapter 2 outline

3.1 IPv4 error control: ICMP

3.2 IPv4 address dynamic configuration: DHCP

3.3 Address Translation: NAT

3.4 Routing in the Internet RIP OSPF BGP

3.5 TCP congestion control

3.6 IP version 6

TCP/IP Architecture Advanced Features

Page 4: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

4

Chapter 2 outline

TCP/IP Architecture Advanced Features

3.1 IPv4 error control: ICMP

3.2 IPv4 address dynamic configuration: DHCP

3.3 Address Translation: NAT

3.4 Routing in the Internet RIP OSPF BGP

3.5 TCP congestion control

3.6 IP version 6

Page 5: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

5

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 6: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

6

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 7: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

7

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 8: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

8

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 9: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

9

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 10: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

10

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 11: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

11

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 12: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

12

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 13: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

13

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 14: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

14

Chapter 2 outline

TCP/IP Architecture Advanced Features

3.1 IPv4 error control: ICMP

3.2 IPv4 address dynamic configuration: DHCP

3.3 Address Translation: NAT

3.4 Routing in the Internet RIP OSPF BGP

3.5 TCP congestion control

3.6 IP version 6

Page 15: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

15

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 16: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

16

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 17: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

17

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 18: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

18

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 19: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

19

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 20: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

20

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 21: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

21

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 22: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

22

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 23: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

23

Chapter 2 outline

TCP/IP Architecture Advanced Features

3.1 IPv4 error control: ICMP

3.2 IPv4 address dynamic configuration: DHCP

3.3 Address Translation: NAT

3.4 Routing in the Internet RIP OSPF BGP

3.5 TCP congestion control

3.6 IP version 6

Page 24: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

24

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 25: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

25

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 26: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

26

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 27: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

27

Types of NAT

Dynamic NAT

Static NAT

NAPT (Network Address Port Translation)

TCP/IP Architecture Advanced Features

Page 28: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

28

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 29: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

29

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 30: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

30

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 31: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

31

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 32: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

32

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 33: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

33

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 34: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

34

Chapter 2 outline

TCP/IP Architecture Advanced Features

3.1 IPv4 error control: ICMP

3.2 IPv4 address dynamic configuration: DHCP

3.3 Address Translation: NAT

3.4 Routing in the Internet RIP OSPF BGP

3.5 TCP congestion control

3.6 IP version 6

Page 35: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

35

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 36: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

36

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 37: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

37

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 38: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

38

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 39: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

39

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 40: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

40

Packet flow Unicast Broadcast Multicast

TCP/IP Architecture Advanced Features

Page 41: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

41

A

B

C D E F

4 flows

2 flows

Unicast Individual flows: one tx, one rx

TCP/IP Architecture Advanced Features

Page 42: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

42

Broadcast one tx, everyone rx

A

B

C D E F

1 flow

1 flow

TCP/IP Architecture Advanced Features

Page 43: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

43

Multicast one flow, only desired rx

A

B

C D E F

1 flow

1 flow

TCP/IP Architecture Advanced Features

Page 44: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

44

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 45: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

45

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 46: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

46

Routing algorithms Classification

Static routing Adaptive routing

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

TCP/IP Architecture Advanced Features

Page 47: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

47

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 48: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

48

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 49: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

49

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 50: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

50

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

Flooding

TCP/IP Architecture Advanced Features

Page 51: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

51

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 52: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

52

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 53: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

53

RIP: Routing Information Protocol

RIP 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 54: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

54

RIP: Routing Information Protocol

RIP 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 55: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

55

RIP: Routing Information Protocol

RIP 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 56: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

56

OSPF: Open Shortest Path First

Open 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 57: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

57

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 58: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

58

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 59: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

59

OSPF header

Checksum: error control

Authentication

Value

Type

1 HELLO

2 Database description

3 Link state request

4 Link state update

5 Link state ACK

TCP/IP Architecture Advanced Features

Page 60: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

60

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 61: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

61

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 62: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

62

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 63: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

63

BGP: Example

TCP/IP Architecture Advanced Features

Page 64: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

64

Chapter 2 outline

TCP/IP Architecture Advanced Features

3.1 IPv4 error control: ICMP

3.2 IPv4 address dynamic configuration: DHCP

3.3 Address Translation: NAT

3.4 Routing in the Internet RIP OSPF BGP

3.5 TCP congestion control

3.6 IP version 6

Page 65: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

65

Principles of Congestion Control

Congestion: 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 66: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

66

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 67: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

67

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 68: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

68

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 69: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

69

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 70: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

70

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 71: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

71

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

tim

eout

Host B

time

X

resend 2nd segment

Host A

Seq=92, 8 bytes data

ACK=100

loss

tim

eout

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 72: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

72

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 73: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

73

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 74: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

74

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 75: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

75

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 76: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

Transport Layer Advanced Features 76

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 77: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

77

Chapter 2 outline

TCP/IP Architecture Advanced Features

3.1 IPv4 error control: ICMP

3.2 IPv4 address dynamic configuration: DHCP

3.3 Address Translation: NAT

3.4 Routing in the Internet RIP OSPF BGP

3.5 TCP congestion control

3.6 IP version 6

Page 78: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

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: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

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: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

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: TCP/IP Architecture Advanced Features1 Chapter 3 TCP/IP Architecture Advanced Features Some of these slides are copyrighted by: Computer Networking: A

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