|
Internet Layer
The Internet Layer exists for routing and providing a single network
interface to the upper layers. IP provides the single network interface for the
upper layers.
Protocols at the Internet Layer are:
IP (Internet Protocol)
The Internet Protocol (IP) is a network-layer (Layer 3) protocol that
contains addressing information and some control information that enables
packets to be routed. IP has two primary responsibilities: providing
connectionless, best-effort delivery of datagrams through an internetwork; and
providing fragmentation and reassembly of datagrams to support data links with
different maximum-transmission unit (MTU) sizes.
All machines on a TCP/IP network have a unique logical address, an IP
address. The Internet Layer (IP) has a complete picture of the entire
network and is responsible for path determination and packet switching. IP
is the transport for TCP, UDP, and ICMP and provides an unreliable service.
It lets the upper layer protocols that use it worry about reliability. IP
will perform as a connectionless service because it handles each datagram as an
independent entity. IP performs packet switching and path determination by
maintaining tables that indicate where to send a packet based on its IP address.
IP gets the destination address from the packet. IP receives segments from
the Host-to-Host layer and fragments them into packets. IP will then
reassemble the packets into segments on the receiving end to send to the
Host-to-Host layer. Each packet has the source and destination IP address.
Each router will make path determinations based on the destination IP address.
ICMP (Internet Control Message Protocol)
The Internet Control Message Protocol (ICMP) is a network-layer Internet
protocol that provides message packets to report errors and other information
regarding IP packet processing back to the source. ICMP utilizes IP to
carry the ICMP data within it through a network.
ICMP Messages
ICMPs generate several kinds of useful messages, including Destination
Unreachable, Echo Request and Reply, Redirect, Time Exceeded, and Router
Advertisement and Router Solicitation. If an ICMP message cannot be delivered,
no second one is generated. This is to avoid an endless flood of ICMP messages.
When an ICMP destination-unreachable message is sent by a router, it
means that the router is unable to send the package to its final destination.
The router then discards the original packet. Destination-unreachable
messages include four basic types: network unreachable, host unreachable,
protocol unreachable, and port unreachable.
- Network-unreachable messages usually mean that a failure has
occurred in the routing or addressing of a packet.
- Host-unreachable messages usually indicates delivery failure,
such as a wrong subnet mask.
- Protocol-unreachable messages generally mean that the
destination does not support the upper-layer protocol specified in the packet.
- Port-unreachable messages imply that the TCP socket or port is
not available.
An ICMP echo-request message, which is generated by the ping command,
is sent by any host to test node reachability across an internetwork. The
ICMP echo-reply message indicates that the node can be successfully
reached. PING - Packet Internet Gropher, uses echo message
to test physical connectivity.
An ICMP Redirect message is sent by the router to the source host to
stimulate more efficient routing. The router still forwards the original packet
to the destination. ICMP redirects allow host routing tables to remain small
because it is necessary to know the address of only one router, even if that
router does not provide the best path. Even after receiving an ICMP Redirect
message, some devices might continue using the less-efficient route.
An ICMP Time-exceeded message is sent by the router if an IP packet's
Time-to-Live field (expressed in hops or seconds) reaches zero. The
Time-to-Live field prevents packets from continuously circulating the
internetwork if the internetwork contains a routing loop. Routers discard
packets that have reached their maximum hop count and tell the source machine
that the packet is expired. Traceroute - uses ICMP timeouts
to find the path a packet takes through the internetwork.
ARP (Address Resolution Protocol)
Used to find the MAC address from the known IP address. ARP sends a broadcast
asking for the machine with the specified IP address to respond with its MAC
address. If two devices want to communicate, the first device can send a
broadcast ARP message requesting the physical address for a specified IP
address. The receiving device responds with its IP address and the first
device maintains the entry in its ARP cache. If a device doesn't exist on
the same subnet, the sending device addresses the the default gateway's physical
address and sends the packet to the default gateway.
RARP Reverse Address Resolution Protocol)
This protocol is used to find an IP address when the MAC address is known.
A machine sends a broadcast with its MAC address and requests its IP address.
An example of a device that uses RARP is a diskless workstation. Since it
can't store its logical network address, it sends its MAC address to a RARP
server to requests its IP address. A RARP server responds to the RARP
request with the device's IP address.
|