hen a datagram is received from a network interface, IP first checks if the destination IP address is one of its own IP addresses or an IP broadcast address. If so, the datagram is delivered to the protocol module specified by the protocol field in the IP header. If the datagram is not destined for this IP layer, then (1) if the IP layer was configured to act as a router the packet is forwarded (that is, handled as an outgoing datagram as described below), else (2) the datagram is silently discarded.
A host address has a nonzero host ID and identifies one particular host. a network address has a host ID of 0 and identifies all the hosts on that network (e.g., Ethernet, token ring).
All hosts are now required to support subnet addressing. Instead of considering an IP address as just a network ID and host ID, the host ID portion is divided into a subnet ID and a host ID.
The ability to specify a route to a network, and not have to specify a route to every host, is another fundamental feature of IP routing.
A different link-layer header can be used on each link, and the link-layer destination address (if present) always contains the link-layer address of the next hop. Ethernet addresses are normally obtained using Address Resolution Protocol (ARP).
All hosts are now required to support subnet addressing. The host ID portion of the IP address is divided into a subnet ID and a host ID. Whether to subnet or not (after obtaining IP network ID of certain class from the internet) is up to the systems administration.
A subnet mask specifies at boot time how many bits are to be used for the subnet ID and how many bits are for the host ID.
ifconfig to configure or query a network interface for use by TCP/IP.
netstat provides information about the interfaces on the system.
-i for interface information,
-n to print IP addresses instead of hostnames.
Chapter 4: Address Resolution Protocol (ARP)
IP addresses are only relevant to the TCP/IP suite. The link layer has its own addressing scheme, which can be used at the same time as TCP/IP: hosts using TCP/IP and a PC network software can share the same physical Ethernet cable.
When an Ethernet frame is sent from one host on a LAN to another, it is the 48-bit Ethernet address that determines for which interface the frame is destined. The device driver software never looks at the destination IP address in the IP datagram.
The Address Resolution Protocol provides a mapping from 32-bit IP addresses to link layer address (for example 48-bit Ethernet address) while Reverse Address Resolution Protocol (RARP) maps back the other direction from the link layer address to the IP address.
The fundamental concept behind ARP is that the network interface has a hardware address (a 48-bit value for an Ethernet or token ring interface). Frames exchanged at the hardware level must be addressed to the correct interface. But TCP/IP works with its own addresses: 32-bit IP addresses. Knowing a host's IP address doesn't let the kernel send a frame to that host. The kernel (i.e., the Ethernet driver) must know the destination's hardware address to send it data. The function of ARP is to provide a dynamic mapping between 32-bit IP addresses and the hardware addresses used by various network technologies.
the ARP cache can be examined with
-a shows all entries.
tcpdump can be used to examine packets.
Chapter 5: Reverse Address Resolution Protocol (RARP)
A system without a disk needs a way to obtain its IP address (usually this is obtained at boot from a configuration file).
Each system on a network has a unique hardware address, assigned by the manufacturer of the network interface. The principle of RARP is for the diskless system to read its unique hardware address from the interface card and send an RARP request (a broadcast frame on the network) asking for someone to reply with the diskless system's IP address (in an RARP reply).
Chapter 6: Internet Control Message Protocol (ICMP)
ICMP is often considered part of the IP layer. It communicates error messages and other conditions that require attention. ICMP messa