test me

Site Search:

IP addressing

Back>
In IP and ICMP Protocols post, we have examined the structure of IP packet and how the IP packets and how IP protocol works. In this post, we will study the details of IP addressing.

The OSI model layer 3, network layer handles the routing of data packets by using IP addresses to identify each device on the network. Each device connected to a computer network has an unique IP address so that data can be sent correctly to it. In the following sections, we will study how to construct an IP address, the classes of IP addresses designated for specific routing purposes and public versus private IP addresses. There are two types of IP addresses: IP version 4 (IPv4) and IP version 6 (IPv6). The 32-bit IPv4 is currently the most common address type, but 128-bit IPv6 address is created to replace the IPv4 in the near future. IPv6 will be studied in detail in icnd2.

IP is the primary protocol in the Network Layer (Layer 3) of the OSI Model and has the task of delivering packets from the source host to the destination host solely based on their addresses. Lets take a close look at the IP packet:


bit offset0–34–78–1516–1819–31
0VersionHeader lengthDifferentiated ServicesTotal Length
32IdentificationFlagsFragment Offset
64Time to LiveProtocolHeader Checksum
96Source Address
128Destination Address
160Options
160
or
192+

Data

The header consists of 13 fields, of which 12 are required. The 13th field is optional (red background in table). Note that each IP datagram carries this header, which includes a source IP address and destination IP address that identify the source and destination network and host.



An IP address is a 32 bit binary number, looks like the following:

00000100 10000000 00000011 00000001

We generally divide them into four 8-bit chunks, called octet, and then represent each 8-bit chunk into decimal number so that human can understand.

For example, the IP address showing above can be represented in decimal number format as

4.128.3.1

An IP address consists of two parts:

  • The leftmost bits specify the network address component, called network ID.

  • The rightmost bits specify the host address components, called host ID.
Hosts on a network can only directly communicate with devices in the same network, that is, the devices with the same network ID. If they need to communicate with devices with different network ID, a Layer 3 router that can route data between the networks is needed. A network ID enables a router to put a packet onto the correct network segment. To decide which network is correct, the router looks up a routing table, which is a table contains entries for network addresses (network ID + all host bits set to 0). Since routing table usually does not contain any information about hosts, the router needs to further check the host ID to decide which host on the network is the correct receiver. The host ID helps the router deliver the Layer 2 frame, encapsulating the packet to a specific host on the network. As a result, the IP address is mapped to the correct MAC address, which is needed by the Layer 2 process on the router to address the frame.

Every physical or virtual LAN on a corporate internetwork is seen as a single network. Each LAN has a unique network ID. The hosts that populate that network share those same network ID. For example, both hosts 192.168.1.100 and 192.168.1.101 resides in the same LAN with network address 192.168.0.0, and share the same network ID 192.168. The host ID of 192.168.1.100 is 1.100. The host ID of 192.168.1.101 is 1.101. We will talk about how to to find out the network portion and host portion of the IP address later.

ICND1 and ICND2 break down

No comments:

Post a Comment