Professional Documents
Culture Documents
E3-E4_Text_Chapter 2. IP CONCEPTS
E3-E4_Text_Chapter 2. IP CONCEPTS
2 IP CONCEPTS
2.2 INTRODUCTION
IP is a very important protocol in modern internetworking; you can't really
comprehend modern networking without a good understanding of IP. Unfortunately, IP
can be somewhat difficult to understand. This is probably because due to its importance,
a large amount of complexity has become associated with the protocol over the years, to
allow it to meet the many demands placed upon it.
Here basic concepts related to the Internet Protocol and how it works are
mentioned. Since the task is more complex that is why the Internet architecture is of a
layered design, which makes testing and future development of Internet protocols easy.
To send data/information from one user to another user through a machine, layers
interact with each other. One layer uses the service of its next lower layer and provides
the service to the next higher layer. Once one layer receives the data/information from its
next higher layer it attaches its own header information. Attaching the header to the
received information, received from the higher layer before handing over to the next
lower layer is called encapsulation. The procedure of encapsulation is shown in figure 1
F F
Time to live Protocol Header checksum
Source address
Destination address
Options (o or more
words)
The source port number is a 16-bit field. The destination port number is also a
16-bit field.There are some fixed, pre-assigned port numbers used for services on the
Internet – for example, number 7 is used for the UDP echo server and number 69 is used
for trivial file transfer (TFTP). These fixed, pre-assigned port numbers are referred to as
well-known ports and controlled by the IANA.
c) Sequence Numbers
The sequence number in the TCP header is 32 bits long and first time randomly
generated by the System. The SN of the first TCP segment identifies the first octet of the
entire stream. Assume this value is n, which was established when the TCP connection
was made. Then, the value of the SSN of the second TCP segment equals n + m, where
m is the octet displacement within the total stream to the beginning of the second TCP
segment.
d) Acknowledgement Numbers
The second sequence number is called the expected receive sequence number
(AKN) – also called the acknowledgement number. The AKN is a 32 – bit field. The
AKN acknowledges the receipt of m – 1 octets by stating the next expected SSN of m.
From the scenario above with the SN of n for the first segment and n + m for the second
segment, the receiver of the first segment would send an ACK with the AKN equal to n
+ m, which acknowledges the receipt of octets n through n + m – 1 by advising that the
next expected SSN is equal to n + m.
e) Header length
The header length is a 4-bit field. It contains an integer equal to the total number
of octets in the TCP header, divided by four. That is, it represents the number of 4-octet
groups in the header. The value of the header length field is typically equal to five unless
there are options. Since there may be options in the TCP header, the pad field is used to
force the number of octets in the header equal to a multiple of four. There may be up to
three octets in the pad field, each containing the value zero.
f) Code Bits
● The purpose and content of the TCP segment is determined by the settings to the
bits in the code bit field.
● URG bit –when urgent bit is set to one then urgent pointer is checked to know the
beginning of the urgent information.
● ACK bit – When the ACK bit is equal to one, the acknowledgement number is
valid and the TCP segment is carrying the acknowledgment.
● PSH bit – Although a transmit buffer may not be full, the sender may force it to
be delivered by setting PSH (Push) flag as one.
● RST bit – Setting the RST bit in a segment causes the connection to be aborted.
All buffers associated with the connection are released and the entry in the TCB
is deleted.
● SYN bit – The SYN bit is set during connection establishment only to
synchronize the sequence numbers.
● FIN bit – The FIN bit is set during connection closing only.
g) Window
The window field is a 16-bit unsigned integer. The window field is used to
advertise the available buffer size (in octets) of the sender to receive data.
h) Checksum
Since the IP layer does not include the data portion of the datagram in its
checksum (protects the IP header only), TCP has its own checksum to provide data
integrity.
a) Flow Control
Flow control is the process of managing the rate of data transmission between
two nodes to prevent a fast sender from outrunning a slow receiver.
b) Time-To-Live Exceeded
To prevent routing loops, the IP datagram contains a time-to-live that is set by
the originator. As each gateway processes the datagram, it decrements by one. When
zero is detected, the gateway sends an ICMP error message to the originator and
discards the datagram.
2.4 IP ADDRESSING
2.4.1 IP Addressing – Introduction
Each host on the internet is assigned a 32-bit integer address called its internet
address or IP address. The clever part of internet addressing is that the integers are
carefully chosen to make routing efficient. Every host and router on the internet has
an IP address, which encodes its network number and host number. The combination
is unique: no two machines have the same IP address. The address is coded to allow a
variable allocation of bits to specify network and host.
The IP address scheme is to break up the binary number into pieces and
represent each piece as a decimal number. A natural size for binary pieces is 8 bits,
which is the familiar byte or octet (octet is the telecommunication term, but two
words can be used interchangeably). So let‘s take our binary number, write it using
groups of 8 bits, and then represent each group as a decimal number:
Example 1: 140.179.220.200
It is sometimes useful to view the values in their binary form.
140 .179 .220 .200
10001100.10110011.11011100.11001000
Every IP address consists of two parts, one identifying the network and one
identifying the host. The Class of the address and the subnet mask determine which
part belongs to the network address and which part belongs to the host address.
Example 2:
The Following table lists the capabilities for class A, B and C addresses.
Addresses beginning with 01111111, or 127 decimal, are reserved for loopback
and for internal testing on a local machine. [You can test this: you should always be able
to ping 127.0.0.1, which points to your own system]
Now we can see how the Class determines, by default, which part of the IP address
belongs to the network (N) and which part belongs to the host (h).
● Class A -- NNNNNNNN.hhhhhhhh. hhhhhhhh. hhhhhhhh
● Class B -- NNNNNNNN.NNNNNNNN. hhhhhhhh. hhhhhhhh
● Class C -- NNNNNNNN.NNNNNNNN.NNNNNNNN. hhhhhhhh
They can be used by anyone setting up internal IP networks, such as a lab or home.
Subnetting
Subnetting an IP Network can be done for a variety of reasons, including
organization, use of different physical media, preservation of address space, and
security. The most common reason is to control network traffic.
Subnet Masking
Applying a subnet mask to an IP address allows you to identify the network and
host parts of the address. The network bits are represented by the 1s in the mask, and
the host bits are represented by the 0s.
Performing a bitwise logical AND operation between the IP address and the
subnet mask results in the Network Address or Number.
For example, using our test IP address and the default Class B subnet mask, we
get:
10001100.10110011.11110000.11001000 140.179.240.200 Class B IP Address
11111111.11111111.00000000.00000000 255.255.0.0 Default Class B S/N Mask
Also, note that although subnet masks with non-contiguous mask bits are
allowed, they are not recommended.
2.5 IP V6 ADDRESSING:
The rapid exhaustion of IPv4 addresses space and to fulfill the future need of IP
addresses, the internet protocol is redesigned. This next generation of the Internet
Protocol, aimed to replace IPv4 on the Internet, (IPv6) in 1995. The address size was
increased from 32 to 128 bits or 16 octets. The new version (IP v6) is not designed to
provide sufficient quantity of addresses alone, but it also allows efficient aggregation for
routing.
The large number of IPv6 addresses allows large blocks to be assigned for
specific purposes and, where appropriate, to be aggregated for efficient routing. All
modern desktop and enterprise server operating systems also support the IPv6 protocol,
along with IPv4 but it is not yet widely deployed in other devices, such as home
networking routers, voice over Internet Protocol (VoIP) and multimedia equipment, and
network peripherals.
Example of an IPv6 address: 2001:0df8:85a7:08d3:1319:8a2e:0370:7334
2.6 CONCLUSION
Internet Protocol (IP) has become a de-facto standard for developing and
implementing data networks and internetworking. It is supported by all the
manufacturers of all types of hardware and software from all developers. All the latest
devices and applications presently in use like smart phones, smart and green building,
smart city etc and various smart devices of future technologies like IOT, M2M will use
IP. Hence, we need larger IP address space, which can be met by migration to IPv6.