Networking Fundamentals
Networking Fundamentals
Module 1
Topologies:
Topology defines the structure of the network of how all the components are
interconnected to each other.
There are two types of topology: physical and logical topology.
Physical topology is the geometric representation of all the nodes in a network.
There are six types of network topology which are:
1. Bus topology:
The bus topology is designed in such a way that all the stations are connected through a
single cable known as a backbone cable.
2. Ring topology:
Ring topology is like bus topology but with connected ends. The node that receives the
message from the previous computer will retransmit to the next node.
3. Tree topology:
The tree topology combines the characteristics of bus topology and star topology. The
computers are connected with each other in hierarchical form.
4. Star topology:
All hosts in star topology are connected to a central device, known as hub device, using the
point to point connection.
5. Mesh topology:
Mesh topology is an arrangement of the network in which computers are interconnected
with each other through various connections.
6. Hybrid topology:
The combination of various different topologies is known as hybrid topology.
LAN, WAN and MAN:
Connecting devices:
Connecting devices are NIC, switch, cable, hub, router and modem.
NIC:
NIC stands for network interface card.
It is a hardware component used to connect a computer with another computer onto a
network.
Hub:
A hub is a hardware device that divided the network connection among multiple devices.
When computer requests for some information from a network, it first sends the request to
the hub through cable.
The hub will broadcast this request to the entire network.
All the devices will check if the request belongs to them or not. If not, the request is
dropped.
Switch:
A switch is a hardware device that connects multiple devices on a computer network.
Switch delivers the message to the correct destination based on the physical address on the
message.
A switch does not broadcast the message to the entire network like the hub. It determines
to whom the message is to be transmitted.
Router:
A router is a hardware device which is used to connect a LAN with an internet connection.
A router forwards the packets based on the information on the routing table.
It determines the best path from the available paths for the transmission of the packet.
Modem:
A modem is a hardware device that allows the computer to connect to the internet over the
existing telephone line.
It converts the digital data into analog signal over telephone lines.
Module 2:
OSI stands for open systems interconnection. It is a 7 layer architecture with each layer
having different functionalities.
These 7 layers work collaboratively (together) to transmit the data from one to another.
The 7 layers are:
1. Application layer
2. Presentation layer
3. Session layer
4. Transport layer
5. Network layer
6. Data link layer
7. Physical layer
The lowest layer of the OSI reference model is the physical layer.
It is responsible for the actual physical connection between the devices.
The physical layer contains data in the form of bits.
It transmits individual bits from one node to the next.
It receives data as 1s and 0s and are sent to data link layer, which is the next layer in
the OSI reference model.
Functionalities of the physical layer:
1. Bit synchronization
2. Bit rate control
3. Physical topologies
4. Transmission mode
The data link layer is responsible for the node to node delivery of the message
The main function of this layer is to make sure data transfer is error free from one
node to the next.
When a packet arrives at the data link layer, it is the responsibility of DDL to transmit
it to the host using MAC address.
Data link layer is divided into two sub layers:
1. Logical link control (LLC)
2. Media access control (MAC)
The packet received from network layer is further divided into frames depending on
the frame size of NIC (network interface card).
DDL also encapsulates (express essential features of) sender and receivers MAC
address.
The receiver’s MAC address is obtained by placing an ARP (address resolution
protocol) request onto the wire and the destination host will reply its MAC address.
Functionalities of DDL:
1. Framing
2. Physical addressing
3. Error control
4. Flow control
5. Access control
Network layer:
Network layer works for the transmission of data from one host to the other located
in different networks.
The data is referred to as packets in network layer
It also takes care of packet routing i.e. selection of the shortest path to transmit the
packet. (routing)
The sender’s and receiver’s IP address are placed in the header by the network layer.
(local addressing)
Functionalities of network layer:
1. Routing
2. Local addressing
Transport layer:
Session layer:
Presentation layer:
Application layer:
At the very top of the OSI reference model, we find the application layer which is
implemented by the network applications.
These applications produce data which has to be transferred over the network
The functionalities of application layer:
1. Network virtual terminal
2. File transfer access and management
3. Mail services
4. Directory services
TCP/IP Protocol:
TCP and IP are the two main protocols. Others are included in the suite (a collection of
protocols that work together to enable devices to communicate and operate in a
compatible way)
TCP/IP is used to interconnect network devices on the internet.
TCP/IP specifies how data is exchanged over the internet by providing end-to-end
communication.
It identify how it should be broken into packets, addressed, transmitted, routed and
received at the destination.
TCP defines how applications can create channels of communication across a network.
It also manages how a message is assembled into smaller packets before they are then
transmitted over the internet and reassembled in the right order at the destination address.
IP defines how to address and route each packet to make sure it reaches the right
destination.
Each gateway computer on the network checks this IP address to determine where to
forward the message.
Common protocols of TCP/IP include the following:
HTTP (Hyper Text Transfer Protocol) handles the communication between a web
server and a web browser.
HTTPS (Secure HTTP) handles secure communication between a web server and a
web browser.
FTP (File Transfer Protocol) handles transmission of files between computers.
The TCP/IP slightly differs from the OSI reference model. The TCP/IP model has 4 layers:
1. Application layer
2. Transport layer
3. Network layer
4. Physical layer
Transport layer:
It is responsible for maintaining end to end communications across the network.
Its only protocol is user datagram protocol (UDP).
Physical layer:
It is also known as network interface layer or data link layer which consists of
protocols that operate on a link to interconnect nodes in the network.
Protocols are Ethernet for LANs and the address resolution protocols (ARP).
Burst error:
In a burst error, multiple bits are changed, means that 2 or more bits in the data
unit have changed from 1 to 0 or 0 to 1.
The number of bits affected or changed depends on the data rate and duration.
Redundancy:
The central concept in detecting or correcting errors is redundancy.
To be able to detect or correct errors we need to send some extra bits with our data.
Some extra bits are added (redundant bits). These redundant bits are added by the sender
and received by the receiver.
Coding:
The sender adds redundant bits through a process that creates a relationship between the
redundant bits and the actual bits.
1. Block coding
2. Convolution coding or linear coding
Block coding:
In block coding, we divide the data into blocks, each of k-bits which are called data-words.
We add r redundant bits to each block to make the length n = k + r where n is called code-
words.
We have a set of data-words each of size k and a set of code-words each of size n.
And with k bits we can create a combination of 2^k data-words and with n bits we can
create a combination of 2^n code-words.
Since n > k, the number of possible code-words is larger than the number of possible data-
words.
Linear coding:
A block code is said to be linear block code if the sum of any two code-word gives another
code-word.
That is, Ck = Ci + Cj
Channel N bits
K bits
Manage block encoding
adding parity check bits linear block code
Check sum:
CRC is known as a Cyclic Redundancy check. It is used to identify errors in data transmission
or storage. It is an error-detecting code that is frequently used in network communication
and data storage.
The checksum scheme uses the addition method but CRC uses binary division.
Hamming distance:
Hamming distance is a metric for comparing two binary data strings. While comparing two
binary strings of equal length, Hamming distance is the number of bit positions in which the
two bits are different.
The Hamming distance between two strings, a and b is denoted as d(a,b).
It is used for error detection or error correction when data is transmitted over computer
networks. It is also using in coding theory for comparing equal length data words.
In order to calculate the Hamming distance between two strings, and , we perform their
XOR operation, (a⊕ b), and then count the total number of 1s in the resultant string.
In a set of strings of equal lengths, the minimum Hamming distance is the smallest Hamming
distance between all possible pairs of strings in that set.
Module 3:
Noiseless channel:
It is an ideal channel in which no frames are lost, duplicated or corrupted
There are 2 types of protocols in this channel:
1. Simplest protocol
2. Stop and wait protocol
Simplest protocol:
In simple protocol there is no error control or flow control
It is a unidirectional protocol in which the frames travel only one direction from sender
to receiver.
The receiver can immediately handle any frame it receives with a processing time that is
small enough to be negligible.
Noisy channel:
Noisy channel are channel in which frames are lost or duplicated and corrupted thus error
control is required.
Stop and wait ARQ:
In a noisy channel, if a frame is changed during transmission, the receiver will detect the
change or the error with the help of checksum.
If a changed frame is received, it will be discarded and the sender will have to transmit
the same frame after receiving a proper acknowledgment.
To solve protocols failure, assign a sequence number in the header of the message.
Tunnelling:
Tunnelling is a protocol that allows for the secure movement of data from one network to
another.
Tunnelling is used when source and destination networks of same type are to be connected
to a different type network.
For example, let us consider an Ethernet connected to another Ethernet using WAN.
Tunnelling works by encapsulating packets, wrapping packets inside of other packets.
IPV4 VS IPV6
IPV4 IPV6
Address mapping:
IP was designed as a best effort delivery protocol but it lacks some features such as error
control and flow control.
To make IP more efficient it takes the help of protocols to create a mapping between
physical and logical address i.e ARP (address resolution protocol)
An internet is made up of a combination of physical networks connected by internetworking
devices such as routers.
A packet starting from a source host may pass through several different networks before
reaching the final destination.
The hosts and routers are recognized by their physical address (MAC) and logical address
(IP).
Thus a packet requires two levels of addressing: logical and physical.
Static mapping:
Static mapping involves in the creation of a table that associates a logical address with a
physical address.
This table can be stored in each device on the network. Each device that knows the IP
address but not the physical address can look up in table.
Static mapping has some limitations as it cannot figure out the physical addresses when it is
changed due to several cases, such as:
A device could change its NIC (network interface card), resulting a new physical
address.
In some LANs, the physical address changes every time we open the device.
A mobile computer can move from one physical network to the other, resulting in a
change in its physical address.
Dynamic mapping:
In such mapping each time a machine knows one of the 2 addresses, it can use a protocol to
find the other one which overcomes the limitations of static mapping.
RARP stands for reverse address resolution protocol, as the name suggests it does the
reverse operation of ARP.
RARP find the logical address for a machine that only knows its physical ad
Module 4
Forwarding techniques:
Forwarding means to place the packet in its route to its destination. Forwarding requires a
host or a router to have a router table.
When a host has a packet to send or when a router has received a packet to be forwarded,
it looks at this table to find the route to final destination.
Forwarding techniques:
Next-hop method:
One technique to reduce the contents of a routing table is next-hop method.
In this techniques, the routing table holds only the address of the next hop instead of
information about the complete route.
Network-specific method:
A second technique to reduce the contents in the routing table and simply searching process
is called network-specific method.
Here, instead of having an entry for every destination host connected to the same physical
network, we have only one entry that defines the address of the destination network itself.
Routing table:
A host or a router has a routing table with an entry for each destination or a combination of
destinations to route IP packets. They can be either static or dynamic.
A static routing table can be used in a small internet that does not change very often and
dynamic routing table is updated periodically by using one of its protocol such as RIP, BGP.
In distance vector routing, the least-cost route between any two nodes is the route with the
minimum distance.
In this protocol, as the name suggests each node maintains a vector (table) of minimum
distances to every node.
The table at each node also guides the packets to the desired node by showing the next hop
in the route.
Multicast routing:
Multicast routing is a protocol that sends one copy of data to multiple users simultaneously
on a closed network.
The most popular uses of multicasting include videoconferencing and streaming media on
organizational networks such as hotels or campuses.
Multicast routing has two protocols based on it: dense mode and sparse mode.
In dense mode it assumes a lot of hosts in the network is interested in receiving the
multicast data.
In sparse mode it assumes that only a few hosts are interested.
RIP:
The routing information protocol (RIP) is an intra-domain routing protocol used inside an
autonomous system.
(Intra-domain means routing the packets in a defined domain)
RIP is a distance vector protocol that uses hop count as its metric.
It defines how routers should share information among an interconnected group of LANs.
If there are 8 routers in a network where Router 1 wants to send the data to Router 3. If the
network is configured with RIP, it will choose the route which has the least number of hops.
Infinity is defined as 16 hops, which means that any route using RIP cannot have more than
15 hops.
TCP features:
1. Connection-oriented protocol:
TCP establishes a reliable connection between sender and receiver before transmitting data
packets. It uses a three way handshake to make a secure connection.
2. Reliable:
TCP provides reliable data transfer and ensures that all data packets are delivered to the
receiver without any loss.
It uses the sequence number for all the sent packets, these packets help to whether all
packets are received.
It also uses an acknowledgement system, the receiver ends acknowledgements to the
sender to notify about the lost packets.
3. Error control:
TCP uses checksum to detect errors in data. Every segment contains a checksum field
required to find a corrupted segment.
If a segment is corrupted, the destination discards it and considers it as lost and sends a
request to resend the packet.
4. Flow control:
It is the process of controlling the flow of segments. It ensures that one host does not flood
other hosts by sending too many packets.
Source port number: this number is the port number that is used by the process running on
the source host.
Destination port number: this is port number that is used by the process running on the
destination host.
Both of the numbers are 16 bit long.
HLEN: this 4 bit field indicate header file length in the TCP.
Reserved: this is a 6 bit field reserved for future use.
Control field: this field defines 6 different control bits or flags as shown in the figure.
The flags are urgent, acknowledgement, push, restart, synchronization and finish.
Sequence port address: it uses the sequence number for all the sent packets, these packets
help to whether all packets are received.
Destination port address: it uses an acknowledgement system, the receiver ends
acknowledgements to the sender to notify about the lost packets.
Window size: the receiver sends a window size to the sender, representing how much data
it can accept at a given time. The sender adjusts its transmission based on that.
TCP connection
UDP is a transport layer protocol which lies between the application layer and network
layer.
It is a communication protocol that allows data to be transferred across the internet.
It is a connectionless protocol as it does not create a virtual path to transfer the data.
The UDP protocol uses different port numbers so the data can be sent to the correct
destination. Some of the UDP ports are,
1. Daytime – returns all the date and time.
2. Nameserver – domain name service.
3. BOOTPs and BOOTPc – it allows server and client port to download bootstrap
information.
4. NTP – network time protocol.
5. Chargen – returns a string of characters.
Even if the UDP is less reliable we require it where the packets require a large amount of
bandwidth along the actual data.
UDP format:
Module 5:
Congestion control:
Congestion in a network may occur if the load on the network id greater than the capacity
of the network.
Congestion control refers to the mechanism and techniques to control the congestion and
keep the load below capacity.
QoS is a mechanism that work on a network to control traffic (congestion) and ensure the
performance of applications. It adjusts congestion problems by prioritizing specific high
performance applications.
Jitter:
The irregular speed of packets on a network as a result of congestion, which can result in
packets arriving late and out of sequence.
Bandwidth:
The speed of a link. The Qos can tell a router how to use bandwidth.
Delay:
The time it takes for a packet to go from its source to its destination gets delayed.
Loss:
The amount of data lost as a result of packet lost which occurs due to network congestion.
It is a service that provides mapping between the name of the host and its numerical
address.
The name of the host is in human readable format like www.amazon.com which is known as
domain name and numerical address is IP address which is a machine readable address like
192.0.2.44
Each node in a tree has a domain name and it is in human readable format. DNS translates
the domain name into IP addresses.
DNS is TCP/IP protocol used on different platforms. The domain name system is divided into
three different sections: generic domains, country domains and inverse domain.
FTP:
SMTP:
URL:
HTTP:
Proxy server:
A proxy server is a system or router that provides a gateway between users and the
internet. Therefore it helps to prevent cyber attackers from entering a private network.
Cookies:
A cookie is a little file that a web server stores on a user’s computer. Cookies are used to
keep track of the user’s browsing actions on a website.
Websites often provide cookies to remember a user’s preferences and login information.
A cookie is sent by a website’s web server to a user’s browsing during a visit and stores it in
the user’s computer.
The browser send the cookie back to the server when the user accesses the server again so
that it remember the user’s preferences.
Cookies may carry some security dangers. Cookies can be used by illegal users to obtain
personal data, like login information and credit card details.