Professional Documents
Culture Documents
Networking With TCP-IP Notes
Networking With TCP-IP Notes
Networking With TCP-IP Notes
(A Govt. Aided UGC Autonomous & NAAC Accredited Institute Affiliated to RGPV, Bhopal)
TCP/IP Model helps you to determine how a specific computer should be connected to the
internet and how data should be transmitted between them. It helps you to create a virtual
network when multiple computer networks are connected together. The purpose of TCP/IP
model is to allow communication over large distances.
TCP/IP stands for Transmission Control Protocol/ Internet Protocol. TCP/IP Stack is
specifically designed as a model to offer highly reliable and end-to-end byte stream over an
unreliable internetwork.
TCP/IP Characteristics
Here, are the essential characteristics of TCP IP protocol:
• Support for a flexible TCP/IP architecture
• Adding more system to a network is easy.
• In TCP IP protocols suite, the network remains intact until the source, and destination
machines were functioning properly.
• TCP is a connection-oriented protocol.
• TCP offers reliability and ensures that data which arrives out of sequence should put
back into order.
• TCP allows you to implement flow control, so sender never overpowers a receiver with
data.
The functionality of the TCP IP model is divided into four layers, and each
includes specific protocols.
TCP/IP is a layered server architecture system in which each layer is defined
according to a specific function to perform. All these four TCP IP layers work
collaboratively to transmit the data from one layer to another.
• Application Layer
• Transport Layer
• Internet Layer
• Network Interface
Application Layer
Application layer interacts with an application program, which is the highest level
of OSI model. The application layer is the OSI layer, which is closest to the end-
user. It means the OSI application layer allows users to interact with other
software application.
Application layer interacts with software applications to implement a
communicating component. The interpretation of data by the application program
is always outside the scope of the OSI model.
Transport Layer
Transport layer builds on the network layer in order to provide data transport from
a process on a source system machine to a process on a destination system. It is
hosted using single or multiple networks, and also maintains the quality-of-
service functions.
It determines how much data should be sent where and at what rate. This layer
builds on the message which are received from the application layer. It helps
ensure that data units are delivered error-free and in sequence.
Transport layer helps you to control the reliability of a link through flow control,
error control, and segmentation or de-segmentation.
The transport layer also offers an acknowledgment of the successful data
transmission and sends the next data in case no errors occurred. TCP is the best-
known example of the transport layer.
Internet Layer
An internet layer is a second layer of TCP/IP layers of the TCP/IP model. It is
also known as a network layer. The main work of this layer is to send the packets
from any network, and any computer still they reach the destination irrespective
of the route they take.
The Internet layer offers the functional and procedural method for transferring
variable length data sequences from one node to another with the help of various
networks.
Message delivery at the network layer does not give any guaranteed to be reliable
network layer protocol.
Layer-management protocols that belong to the network layer are:
1. Routing protocols
2. Multicast group management
3. Network-layer address assignment.
ADDRESSING:
Four levels of addresses are used in an internet employing the TCP/IP protocols:
physical (link) addresses, logical (IP) addresses, port addresses, and specific
addresses.
Addressing in TCP/IP
Physical Addresses:
The physical address, also known as the link address, is the address of a node
as defined by its LAN or WAN. It is included in the frame used by the data
link layer. It is the lowest-level address.
The physical addresses have authority over the network (LAN or WAN). The
size and format of these addresses vary depending on the network. For
example, Ethernet uses a 6-byte (48-bit) physical address that is imprinted
on the network interface card (NIC). Local Talk (Apple), however, has a I-byte
dynamic address that changes each time the station comes up.
Logical Addresses:
The logical addresses are designed for this purpose. A logical address in the
Internet is currently a 32-bit address that can uniquely define a host
connected to the Internet.
Port Addresses:
The IP address and the physical address are necessary for a quantity of data
to travel from a source to the destination host. However, arrival at the
destination host is not the final objective of data communications on the
Internet. A system that sends nothing but data from one computer to another
is not complete. Today, computers are devices that can run multiple
processes at the same time. The end objective of Internet communication is a
process communicating with another process. For example, computer A can
communicate with computer C by using TELNET. At the same time, computer
A communicates with computer B by using the File Transfer Protocol (FTP).
For these processes to receive data simultaneously, we need a method to
label the different processes. In other words, they need addresses. In the
TCP/IP architecture, the label assigned to a process is called a port address.
A port address in TCP/IP is 16 bits in length.
Specific Addresses:
Some applications have user-friendly addresses that are designed for that
specific address.
Examples include the e-mail address and the Universal Resource Locator
(URL). The first defines the recipient of an e-mail; the second is used to find
a document on the World Wide Web. These addresses, however, get
changed to the corresponding port and logical addresses by the sending
computer.
Comparison Chart:
User can view the logical address User can never view physical
Visibility
of a program. address of program.
The user can use the logical address The user can indirectly access
Access
to access the physical address. physical address but not directly.
Editable Logical address can be change. Physical address will not change.
Classful Addressing:
The first addressing system to be implemented as part of the Internet Protocol was Classful
Addressing. In the year 1981, the Classful addressing network architecture was first used on
the Internet. The Classful addressing system was superseded by a Classless addressing scheme
with the introduction of Classless Inter-Domain Routing (CIDR) in 1993.
➢ The IP address comprises up of 32 bits and is split into four sections separated by dots:
part 1, part 2, part 3, and part 4.
➢ The IP address is made up of four parts, each of which is eight bits long (1 byte).
➢ Further, the 4 parts of the IP address is divided into parts: a network ID and a Host ID.
➢ The first three classes, Class A, B, and C, are used for "public addressing", in which
communication is always one-to-one between source and destination. It implies that
when data is transmitted from a source, it will only be sent to a single network host.
➢ The reserved categories include Class D and Class E, with Class D being utilized for
multicast and Class E being saved for future usage exclusively.
➢ In IPv4, the Network ID is the first part of Class A, B, and C, while the Host ID is the
remaining second portion.
➢ The Host ID always indicates the number of hosts or nodes in a certain network,
whereas the Network ID always identifies the network in a specific place.
➢ In Class A, B, and C, the address space is split into a certain number of IP address
blocks. It also specifies the maximum number of hosts in a network.
➢ The network ID takes up the first two octets or two bytes in Class B, whereas the host
ID takes up the remaining two octets or two bytes.
➢ In Class C, the first three octets or bytes are dedicated to the network ID, while the
last octet or byte is dedicated to the host ID.
Classless Addressing:
Classless Inter-Domain Routing (CIDR) is another name for classless addressing. This
addressing type aids in the more efficient allocation of IP addresses. This technique assigns a
block of IP addresses based on specified conditions when the user demands a specific amount
of IP addresses. This block is known as a "CIDR block", and it contains the necessary number
of IP addresses.
When allocating a block, classless addressing is concerned with the following three rules.
• The network component has a bit count of 27, whereas the host portion has a bit count
of 5. (32-27)
• The binary representation of the address is: (00100011. 11000000. 10101000.
00000001).
• (11000000.10101000.00000001.00100000) is the first IP address (assigns 0 to all host
bits), that is, 192.168.1.32
• (11000000.10101000.00000001.00111111) is the most recent IP address (assigns 1 to
all host bits), that is, 192.168.1.63
• The IP address range is 192.168.1.32 to 192.168.1.63.
➢ Classful addressing is a technique of allocating IP addresses that divides them into five
categories. Classless addressing is a technique of allocating IP addresses that is intended
to replace classful addressing in order to reduce IP address depletion.
➢ The utility of classful and classless addressing is another distinction. Addressing
without a class is more practical and helpful than addressing with a class.
➢ The network ID and host ID change based on the classes in classful addressing. In
classless addressing, however, there is no distinction between network ID and host ID.
As a result, another distinction between classful and classless addressing may be made.
DHCP allows a network administrator to supervise and distribute IP addresses from a central
point and automatically sends a new Internet Protocol (IP) address when a computer is plugged
into a different place in the network.
➢ Subnet Mask
➢ Router Address
➢ IP Address
In DHCP, the client and the server exchange DHCP messages to establish a connection.
• It is the first message produced by a client in the communication process between the
client and server with the target address 255.255.255.255 and the source address
0.0.0.0.
• This message is produced by the client host to discover if there are any DHCP servers
present in a network or not.
• The message might contain other requests like subnet mask, domain name server, and
domain name, etc.
• The message is broadcast to all the devices in a network to find the DHCP server.
• The DHCP server will reply/respond to the host in this message, specifying the
unleashed IP address and other TCP configuration information.
• This message is broadcasted by the server.
• If there are more than one DHCP servers present in the network, then the client host
accepts the first DHCP OFFER message it receives.
• Also, a server ID is specified in the packet to identify the server.
• The Client receives the DHCP offer message from the DHCP server that
replied/responded to the DHCP discover message.
• After receiving the offer message, the client will compare the offer that is requested,
and then select the server it wants to use.
• The client sends the DHCP Request message to accept the offer, showing which
server is selected.
• Then this message is broadcast to the entire network to let all the DHCP servers know
which server was selected.
• If a server receives a DHCP Request message, the server marks the address as leased.
• Servers that are not selected will return the offered addresses to their available pool.
• Now, the selected server sends the client an acknowledgment (DHCP ASK), which
contains additional configuration information.
• The client may use the IP address and configuration parameters. It will use these
settings till its lease expires or till the client sends a DHCP Release message to the
server to end the lease.
DHCP Request, DHCP ACK Message − Client attempts to renew the lease
• The client starts to renew a lease when half of the lease time has passed.
• The client requests the renewal by sending a DHCP Request message to the server.
• If the server accepts the request, it will send a DHC ACK message back to the client.
• If the server does not respond to the request, the client might continue to use the IP
address and configuration information until the lease expires.
• As long as the lease is still active, the client and server do not need to go through the
DHCP Discover and DHCP Request process.
• When the lease has expired, the client must start over with the DHCP Discover process.
• The client ends the lease by sending a DHCP Release message to the DHCP server.
• The server will then return the client's IP address to the available address pool and
cancel any remaining lease time.
Components of DHCP
When working with DHCP, it is important to understand all of the components. Following are
the list of components:
o DHCP Server: DHCP server is a networked device running the DCHP service that
holds IP addresses and related configuration information. This is typically a server or a
router but could be anything that acts as a host, such as an SD-WAN appliance.
o DHCP client: DHCP client is the endpoint that receives configuration information
from a DHCP server. This can be any device like computer, laptop, IoT endpoint or
anything else that requires connectivity to the network. Most of the devices are
configured to receive DHCP information by default.
o IP address pool: IP address pool is the range of addresses that are available to DHCP
clients. IP addresses are typically handed out sequentially from lowest to the highest.
o Subnet: Subnet is the partitioned segments of the IP networks. Subnet is used to keep
networks manageable.
o Lease: Lease is the length of time for which a DHCP client holds the IP address
information. When a lease expires, the client has to renew it.
o DHCP relay: A host or router that listens for client messages being broadcast on that
network and then forwards them to a configured server. The server then sends responses
back to the relay agent that passes them along to the client. DHCP relay can be used to
centralize DHCP servers instead of having a server on each subnet.
Benefits of DHCP
There are following benefits of DHCP:
Dynamic host configuration: DHCP automates the host configuration process and eliminates
the need to manually configure individual host. When TCP/IP (Transmission control
protocol/Internet protocol) is first deployed or when IP infrastructure changes are required.
Seamless IP host configuration: The use of DHCP ensures that DHCP clients get accurate
and timely IP configuration IP configuration parameter such as IP address, subnet mask, default
gateway, IP address of DND server and so on without user intervention.
Flexibility and scalability: Using DHCP gives the administrator increased flexibility,
allowing the administrator to move easily change IP configuration when the infrastructure
changes.
Advantages of DHCP
The advantages of using DHCP include:
Disadvantages of DHCP
The disadvantage of using DHCP is:
NAT (Network Address Translation) connects two networks and maps the private (inside
local) addresses into public addresses (inside global). Inside local denotes that the best address
belonged to an internal network and was not assigned by a Network Information
Centre or service power. The inside global signifies that the address is a valid address assigned
by the NIC or service provider, and one or more inside local addresses to the outside world.
NAT is a method of converting a private IP address or a local address into a public IP address.
NAT is a technique for reducing the rate at which available IP addresses are depleted by
translating a local IP or private IP address into a global or public IP address. The NAT relation
might be one-to-one or many-to-one.
Furthermore, NAT can only configure one address in order to represent the entire network to
the outside world. As a result, the translation process is transparent. NAT can be used to migrate
and merge networks, share server loads, and create virtual servers, etc.
Types of NAT:
There are three types of NAT:
➢ Static NAT
In static NAT, a local address is mapped to a global address. In this type of NAT, the
relationship is one-to-one. Static NAT is used if a host needs a consistent address that must be
acceded from the internet. For example, networking devices or enterprise servers.
➢ Dynamic NAT
Unregistered private IP addresses can be converted to registered public IP numbers from a pool
of public IP addresses using dynamic NAT.
Among the three varieties, PAT is the most famous. It's a form of Dynamic NAT that's
comparable to it, but it uses ports to translate many private IP addresses to a single public IP
address.
Advantages of NAT
• NAT protects the public addresses that have been registered and slow down the IP
address space exhaustion.
• Removes the address renumbering process that occurs when switching networks
• The occurrence of address overlap was significantly reduced.
• Increases flexibility of the connection establishment.
Disadvantages of NAT
In order to identify the different translations, it uses a unique source port address on the inside
global IP address. Because the port number is encoded in 16 bits, the total number of NAT
translations that can be performed is 65536.
The original source is preserved by the PAT. If the source port is already allocated, the
available ports are searched. The ports groups are split into three ranges 0 to 511,
512 to 1023, and 1024 to 65535.
If PAT doesn't find an available port from the proper port group and if more than one
external IPv4 address is configured, PAT moves to the next IPv4 address and tries to allocate
the original source port until it runs out of available ports and external IPv4 addresses.
Advantages of PAT
The following are the advantages of PAT:
• Conserve IP addresses by assigning single public IP to a group of hosts using different
port numbers.
• Lessens security flaws or security attacks as the private address prevent the public
address from being exposed.
Disadvantages of PAT
• The internal table can only have a certain number of entries to keep track of
connections.
• In PAT, more than one instance of the same sort of public service cannot be run from
the same IP address.
Subnetting is the procedure to divide the network into sub-networks or small networks, these
smaller networks are known as subnets. The subnet is also defined as an internal address made
up of a combination of a small network and host segments. In a subnet, a few bits from the host
portion are used to design small-sized subnetworks from the original network. In subnetting,
network bits are converted into host bits.
Supernetting is the procedure to combine small networks into larger spaces. In subnetting,
Network addresses’ bits are increased. on the other hand, in Supernetting, Host addresses’ bits
are increased. Subnetting is implemented via Variable-length subnet masking, while super
netting is implemented via Classless interdomain routing.
Subnetting Supernetting
In subnetting, the mask bits are While In Supernetting, the mask bits are
moved towards the right. moved towards the left.
Advantages of subnetting
• Effective IP address use: Subnetting enables the division of a large network into smaller
subnets, which aids in the efficient use of IP address allocation. It lessens IP address
wastage and enables organizations to allocate IP addresses in accordance with their
unique requirements.
• Subnetting can help reduce network congestion and enhance overall network
performance by breaking up a large network into smaller subnets. Smaller subnets
improve the efficiency of routing and switching operations and allow for better network
traffic control.
• Increased network security: Subnetting makes it possible to implement security
measures more precisely. Organizations can improve security by controlling access
between subnets and implementing firewall rules by isolating various subnets from one
another.
Disadvantages of subnetting
• Complexity: Subnetting can make network configuration and design more complicated.
It can be difficult, especially for large networks, to choose the right subnet sizes, plan
IP address ranges, and manage routing between subnets.
• Subnetting requires more administrative work, especially when adding new subnets or
changing the configuration of existing ones. In addition to maintaining routing tables
and ensuring proper connectivity between subnets, it entails managing IP address
ranges.
Advantages of Supernetting
• Supernetting enables the consolidation of several smaller networks into a single, larger
network block, which reduces the size of the routing table and maximizes the use of IP
address space.
• Routing can be made easier by combining several smaller networks into a supernet
because fewer routing updates and table entries are required. This may result in
increased routing effectiveness and decreased router overhead.
Disadvantages of Supernetting
• Loss of network granularity: Supernetting involves aggregating multiple networks into
larger network blocks. This can result in a loss of granularity, making it more
challenging to implement fine-grained network management, security policies, and
traffic control.
• Increased risk of network failures: If a single supernet experiences a network failure, it
can affect multiple smaller networks within that supernet. This makes troubleshooting
and isolating network issues more complex.
• Limited flexibility: Supernetting requires careful planning and coordination to ensure
that the aggregated networks have compatible address ranges. It may limit the ability
to make independent changes to individual subnets within a supernet without affecting
the entire supernet.