28
Internet Control Protocols Savera Tanwir

Control Procol s

Embed Size (px)

DESCRIPTION

Lol

Citation preview

Page 1: Control Procol s

Internet Control ProtocolsSavera Tanwir

Page 2: Control Procol s

Internet Control Protocols ICMP ARP RARP DHCP

Page 3: Control Procol s

The IP (Internet Protocol) relies on several other protocols to perform necessary control and routing functions:

Control functions (ICMP) Multicast signaling (IGMP) Setting up routing tables (RIP, OSPF, BGP, PIM, …)

Control

Routing

ICMP IGMP

RIP OSPF BGP PIM

Overview

Page 4: Control Procol s

ICMP The Internet Control Message Protocol

(ICMP) is a helper protocol that supports IP with facility for Error reporting Simple queries

ICMP messages are encapsulated as IP datagrams:

IP header ICMP message

IP payload

Page 5: Control Procol s

ICMP Query message

ICMP query: Request sent by host to a router or host Reply sent back to querying host

Host

ICMP Request

Host or router

ICMP Reply

Page 6: Control Procol s

Example of ICMP QueriesType/Code: Description

8/0 Echo Request0/0 Echo Reply

13/0 Timestamp Request14/0 Timestamp Reply

10/0 Router Solicitation9/0 Router Advertisement The ping command

uses Echo Request/ Echo Reply

Page 7: Control Procol s

Ping’s are handled directly by the kernel Each Ping is translated into an ICMP Echo

Request The Ping’ed host responds with an ICMP Echo

Reply

Example of a Query: Echo Request and Reply

Hostor

Router

ICMP ECHO REQUESTHost or

router

ICMP ECHO

REPLY

Page 8: Control Procol s

ICMP Error message

ICMP error messages report error conditions Typically sent when a datagram is discarded Error message is often passed from ICMP to

the application program

Host

IP datagram

Host or router

ICMP ErrorMessage

IP datagramis discarded

Page 9: Control Procol s

ICMP Error message

ICMP error messages include the complete IP header and the first 8 bytes of the payload (typically: UDP, TCP)

Unused (0x00000000)

IP header ICMP header IP header 8 bytes of payload

ICMP Message

from IP datagram that triggered the error

type code checksum

Page 10: Control Procol s

Frequent ICMP Error message

Type

Code Description

3 0–15 Destination unreachable

Notification that an IP datagram could not be forwarded and was dropped. The code field contains an explanation.

5 0–3 Redirect Informs about an alternative route for the datagram and should result in a routing table update. The code field explains the reason for the route change.

11 0, 1 Time exceeded

Sent when the TTL field has reached zero (Code 0) or when there is a timeout for the reassembly of segments (Code 1)

12 0, 1 Parameterproblem

Sent when the IP header is invalid (Code 0) or when an IP header option is missing (Code 1)

Page 11: Control Procol s

Some subtypes of the “Destination Unreachable”

Code Description Reason for Sending

0 Network Unreachable

No routing table entry is available for the destination network.

1 Host Unreachable

Destination host should be directly reachable, but does not respond to ARP Requests.

2 Protocol Unreachable

The protocol in the protocol field of the IP header is not supported at the destination.

3 Port Unreachable

The transport protocol at the destination host cannot pass the datagram to an application.

4 Fragmentation Needed and DF Bit Set

IP datagram must be fragmented, but the DF bit in the IP header is set.

Page 12: Control Procol s

Example: ICMP Port Unreachable

RFC 792: If, in the destination host, the IP module cannot deliver the datagram because the indicated protocol module or process port is not active, the destination host may send a destination unreachable message to the source host.

Scenario:

Client

Request a serviceat a port 80

Server

No process is waiting at port 80

Port

Unreachabl

e

Page 13: Control Procol s

NetworkLayer

Link Layer

IP

ARP NetworkAccess RARP

Media

ICMP IGMP

TransportLayer

TCP UDP

ARP/RARP Overview

Page 14: Control Procol s

ARP and RARP Note:

The Internet is based on IP addresses Data link protocols (Ethernet, FDDI, ATM) may have different

(MAC) addresses The ARP and RARP protocols perform the translation

between IP addresses and MAC layer addresses We will discuss ARP for broadcast LANs, particularly

Ethernet LANs

RARP

Ethernet MACaddress(48 bit)

ARPIP address(32 bit)

Page 15: Control Procol s

Processing of IP packets by network device drivers

loopbackDriver

IP Input

Put on IPinput queue

ARP demultiplexEthernet Frame

Ethernet

IP destination of packet= local IP address ?

IP destination = multicastor broadcast ?

IP Output

Put on IPinput queue

No: get MACaddress withARP

ARPPacket

IP datagram

No

Yes

Yes EthernetDriver

Page 16: Control Procol s

Address Translation with ARPARP Request:

Argon broadcasts an ARP request to all stations on the network: “What is the hardware address of Router137?”

Argon128.143.137.144

00:a0:24:71:e4:44

Router137128.143.137.1

00:e0:f9:23:a8:20

ARP Request:What is the MAC addressof 128.143.71.1?

Page 17: Control Procol s

Address Translation with ARPARP Reply:

Router 137 responds with an ARP Reply which contains the hardware address

Argon128.143.137.144

00:a0:24:71:e4:44

Router137128.143.137.1

00:e0:f9:23:a8:20

ARP Reply:The MAC address of 128.143.71.1is 00:e0:f9:23:a8:20

Page 18: Control Procol s

ARP Packet Format

Destinationaddress

6

ARP Request or ARP Reply

28

Sourceaddress

6 2

CRC

4

Type0x8060 Padding

10

Ethernet II header

Hardware type (2 bytes)

Hardware addresslength (1 byte)

Protocol addresslength (1 byte) Operation code (2 bytes)

Target hardware address*

Protocol type (2 bytes)

Source hardware address*

Source protocol address*

Target protocol address*

* Note: The length of the address fields is determined by the corresponding address length fields

Page 19: Control Procol s

Example ARP Request from Argon:

Source hardware address: 00:a0:24:71:e4:44Source protocol address: 128.143.137.144Target hardware address: 00:00:00:00:00:00Target protocol address: 128.143.137.1

ARP Reply from Router137: Source hardware address: 00:e0:f9:23:a8:20 Source protocol address: 128.143.137.1 Target hardware address: 00:a0:24:71:e4:44Target protocol address: 128.143.137.144

Page 20: Control Procol s

ARP Cache Since sending an ARP request/reply for each

IP datagram is inefficient, hosts maintain a cache (ARP Cache) of current entries. The entries expire after 20 minutes.

Contents of the ARP Cache:(128.143.71.37) at 00:10:4B:C5:D1:15 [ether] on eth0(128.143.71.36) at 00:B0:D0:E1:17:D5 [ether] on eth0(128.143.71.35) at 00:B0:D0:DE:70:E6 [ether] on eth0(128.143.136.90) at 00:05:3C:06:27:35 [ether] on eth1(128.143.71.34) at 00:B0:D0:E1:17:DB [ether] on eth0(128.143.71.33) at 00:B0:D0:E1:17:DF [ether] on eth0

Page 21: Control Procol s

Things to know about ARP What happens if an ARP Request is made for a non-

existing host? Several ARP requests are made with increasing time intervals between requests. Eventually, ARP gives up.

On some systems (including Linux) a host periodically sends ARP Requests for all addresses listed in the ARP cache. This refreshes the ARP cache content, but also introduces traffic.

Gratuitous ARP Requests: A host sends an ARP request for its own IP address: Useful for detecting if an IP address has already been

assigned.

Page 22: Control Procol s

Dynamic Assignment of IP addresses

Dynamic assignment of IP addresses is desirable for several reasons: IP addresses are assigned on-demand Avoid manual IP configuration Support mobility of laptops

Three Protocols: RARP (until 1985, no longer used) BOOTP (1985-1993) DHCP (since 1993)

Only DHCP is widely used today.

Page 23: Control Procol s

Solutions for dynamic assignment of IP addresses

Reverse Address Resolution Protocol (RARP) RARP is no longer used Works similar to ARP Broadcast a request for the IP address

associated with a given MAC address RARP server responds with an IP address Only assigns IP address (not the default router

and subnetmask)

RARP

Ethernet MACaddress(48 bit)

ARPIP address(32 bit)

Page 24: Control Procol s

DHCP Dynamic Host Configuration Protocol

(DHCP) Designed in 1993 An extension of BOOTP (Many similarities to BOOTP) Same port numbers as BOOTP Extensions:

Supports temporary allocation (“leases”) of IP addresses DHCP client can acquire all IP configuration parameters

DHCP is the preferred mechanism for dynamic assignment of IP addresses

DHCP can interoperate with BOOTP clients.

Page 25: Control Procol s

DHCP Interaction (simplified)Argon

00:a0:24:71:e4:44 DHCP Server

DHCP Request00:a0:24:71:e4:44Sent to 255.255.255.255

Argon128.143.137.144

00:a0:24:71:e4:44 DHCP ServerDHCP Response:IP address: 128.143.137.144Default gateway: 128.143.137.1Netmask: 255.255.0.0

Page 26: Control Procol s

DHCP Operation

DCHP DISCOVER

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCPDISCOVERSent to 255.255.255.255

DHCP Server

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPOFFER

DHCPOFFER DCHP OFFER

Page 27: Control Procol s

DHCP OperationDHCP Client

00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPREQUEST

DHCPACK DCHP REQUEST

At this time, the DHCP client can start to use the IP address

DHCP Client00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPREQUEST

DHCPACK Renewing a Lease(sent when 50% of lease has expired)

If DHCP server sends DHCPNACK, then address is released.

Page 28: Control Procol s

DHCP OperationDHCP Client

00:a0:24:71:e4:44 DHCP Server

DHCP Server

DHCPRELEASE

DCHP RELEASE

At this time, the DHCP client has released the IP address