Working
Working
Topology
Network topology is combination of nodes and connecting lines b/w nodes. It
describe how computers are connected among them
Category of topology:
a) Mesh Topology :
In mesh topology, each device is connected to every another device via
particular connecting lines. These connecting lines are known as channels.
Category of Network
For example, Let the window size is 7 (see diagram), if frames 0 through 3 have
been sent and no acknowledgment has been received, then the sender's
window contains three frames - 4,5,6.
Now, if an ACK numbered 3 is received by source, it means three frames (0, 1,
2) have been received by receiver and are undamaged.
The sender's window will now expand to include the next three frames in its
buffer.
It contains two sub-layers:
Sub-Layer:
Logical link control:
Data link layer handles framing & physical addressing, flow
control, and error control. Flow control, error control handled by logical link
control layer. Framing is handled in both the LLC sublayer and the MAC
sublayer
Media Access Control (MAC) sublayer:
The framing function is also handled by the MAC layer. In order to
communicate or transfer the data from one computer to another computer we
need some address. Media Access Control (MAC) sublayer use the MAC
Address. MAC Address is word wide unique.
Type of Addressing:
A source address is always a unicast address—the frame comes from
only one station. The destination address, can be unicast, multicast, or
broadcast
Unicast:
A unicast destination address defines only one recipient; the relationship
between the sender and the receiver is one-to-one(from one source to one
destination). ( Whats up msg)
Multicast :
A multicast destination address defines a group of addresses; the relationship
between the sender and the receivers is one-to-many( from one source to
multiple destinations). (video conferencing,tele conferencing)
Broadcast :
The broadcast address is a special case of the multicast address; If the message
is sent to all the nodes in a network it is called Broadcasting.( [Link]
channels),the relationship between the sender and the receivers is One-to-All
(from one source to all possible destinations)
About Mac address:
MAC addresses are unique 48-bits(6 bytes) physical address which works at
data link layer of a [Link] address is embedded into network card
(known as Network Interface Card) during the time of manufacturing. Usually,
MAC address usually represented by 12-digit hexadecimal number.
The least significant bit of the first byte defines the type of address.
If the bit is 0, the address is unicast otherwise, it is multicast . if all the bits are
1s ,it is called Broadcast address.
Address Resolution Protocol (ARP)
A system wants to communicate with other system it must know the logical(ip)
and physical(mac) address of the other system.
ARP Used to create a mapping between physical and logical addresses of both
sender and receiver. An ARP request is broadcast; an ARP reply is unicast
The steps involved in ARP process
1. The sender knows the IP address of the target.
2. Sender asks ARP to create an ARP request message .this message
contain sender physical address, the sender IP address, and the
target IP address.
3. The message is passed to the data link layer.
4. Every connected host receives the frame. The target machine
recognizes its IP address.
5. The target machine replies with an ARP reply message. This message
contains target physical address. The message is unicast.
6. The sender receives the reply message with target physical address.
7. Now sender send data gram to target machine in unicast approach.
3. Network Layer (Layer 3) :
(logical addressing, routing, fragmentation)
It is 3rd layer of OSI model.
It converts segments into packets and assign logical address(adds logical
addresses (IP address) of sender and receiver) to packets then forward it
to data link layer which is called logical addressing.
It decides the best route to send the data in a network which is called
Routing and responsible for Fragmentation.
Device works under this layer: Router, Brouter, L3 switch
Protocols: IP (ipv4 & ipv6) ,ICMP,IGMP
Here datagram called as packets
Function of Network layer
Routing:
The network layer protocols determine which route is suitable from source to
destination. This function of network layer is known as routing.
logical addressing.
Network layer adds logical addresses (IP address) of sender and receiver to the
packets and forward to data link layer
Fragmentation:
The fragmentation is a process of breaking the packets into the smallest
individual data units which travel through different networks.
Important protocols:
IPV4:
If a computer needs to communicate with another computer in the
world through internet, The packet will transmit through several LANs or
WANs before reaching the destination computer. For this level of
communication, we need a global addressing scheme such as IP address.
IP address is a logical address of network layer. The IP address is 32 bits length;
this gives us a maximum of 2^32 addresses.
The Internet Protocol version 4 (IPv4) is the delivery mechanism used by the
TCP/IP protocols.IPv4 provides no error control and flow control mechanism.
IPv6 ADDRESSES
IPV6(Internet protocol version 6) introduced due to the shortage of IPV4. An
IPv6 address is 128 bits long.
Advantages
• In real-time audio and video transmission requires minimum delay
strategies. This functionality not provided in the IPv4 design.
• No encryption or authentication is provided by IPv4.
• Ipv6 has Large Address space( I.e.:128bit)
Understand:
IP and IPv4 are not same because IPv4(internet protocol version 4) is a part of
IP(internet Protocol).
Two versions of the Internet Protocol are available
1.IPv4(32-bit) address
2. IPv6(128-bit) address
Ipv4 vs ipv6:
IPv4 and IPv6 are internet protocol version 4 and internet protocol version 6,
IPV6 is the new version of Internet Protocol, which is better than IPV4 in terms
of complexity and efficiency
Basis for IPv4 IPv6
differences
Basic IPv4 is a 32-Bit IP Address. It is a IPv6 is 128 Bit IP Address. It is an
numeric address alphanumeric address
Type of Unicast, broadcast, and multicast. Unicast, multicast, and anycast.
Addresses
Number of IPV4 offers five different classes of lPV6 allows storing an unlimited
classes IP Address. Class A to E. number of IP Address.
Best feature NAT implemented because of It allows direct addressing
shortage of ipv4 address. NAT used because of vast address Space.
to convert public IP address into
private IP address vise versa
support Not support audio and video Supports audio and video
transmission transmission
security Not providing authentication and IPSEC is inbuilt security feature in
encryption feature the IPv6 protocol
Classless Addressing
Classless Addressing is an improved IP Addressing system. It makes the
allocation of IP Addresses more efficient.
It replaces the older classful addressing system which is based on classes.
It is also known as Classless Inter Domain Routing (CIDR).
Rules For Creating CIDR Block
A CIDR block is created based on the following 3 rules-
Rules:
All the IP Addresses in the CIDR block must be contiguous.
The size of the block must be representable as power of 2. Size of any
CIDR block will always be in the form 21, 22, 23, 24, 25 and so on.
FOR UNDERSTANDING:
Above example tell simple things.192.---.---.--- represent calss [Link] CLASS C ,24
bit reserved for network [Link],8(32-24) bits for host id. here, CIDR also
24([Link]/24).so,no need to borrow bit from host [Link]:network bit
represent by 1 and host bit represent by [Link] of that ,the numerical value
[Link] is the starting subnet address of class c. which is network [Link]
get subnet from network bit not from host bit.
An example of CIDR IP Address is-
[Link] / 28
It suggests-
28 bits are used for the identification of network.
Remaining 4 bits are used for the identification of hosts in the network.
Note:
In ipv4 addressing a block of addresses can be defined as x.y.z.t/n .Here,
x.y.z.t is one of the address and n is mask
The first address in the block can be found by setting the rightmost 32-n
bits to 0
The last address in the block can be found by setting the rightmost 32-n
bits to 1
The number of address can be found by 232-n
NAT(Network address translation):
NAT is stands for Network address translation. NAT Used widely because of the
shortage of IP address. NAT used to convert public ip address into private ip
address and private ip address into public ip address. To implement this,
Internet authorities have reserved three set of addresses as private addresses.
note:ipv4 is 32 bit address and it has around 4.2 billion of ip address but the
population of our world is more then 7.4 billion according to [Link]
internet all devices need ip [Link] ,4.2 billion ip address not sufficient for
7.4 billion users for this reason we use NAT.
Here, all the 4 computer assign to the private ip address. whenever pc wants to
access the internet it will request the router. the router going to convert the
private address of pc into public address add a unique port number to [Link]
save this information to NAT table. After that router forward the request into
the internet. when the router receive the reply from the internet,it will send
the reply to the particular pc by the help of NAT table. the unique port number
used to identify the particular pc.
[Link] Layer (Layer 4) :
(flow control, error control)
It is forth layer of OSI model.
This layer is responsible for segmentation (divide data into multiple
segment) and flow control and error control and sequencing.
It converts data into segments and forward to network layer
Devices: Gateway ,Firewall
Protocols: TCP, UDP, SCTP
Datagram at transport layer called segment.
Note: Revise function of transport layer from your notes.
Functions of Transport Layer:
Flow control:
The transport layer also responsible for flow control but it is performed end-
to-end rather than a single link.
Error control:
The transport layer is also responsible for Error control. Error control is
performed end-to-end rather than the single link. The sender transport layer
ensures that message reach at the destination without any error.
Important Protocols
Transmission Control Protocol
It allows the different systems to communicate over the internet. It is used for
transfer file and error checking.
TCP is a connection-oriented protocol and reliable .Because it provides flow
control and error control and congestion control mechanism at transport
layer.
TCP is a byte-oriented protocol not a message oriented protocol. It receives a
messages from a process, stores them as bytes, and sends them as a
segments. There is no preservation of the message boundaries.
Note: A "message boundary" is the separation between two messages being
sent over a protocol. UDP preserves message boundaries. If you send "FOO"
and then "BAR" over UDP, the other end will receive two datagrams, one
containing "FOO" and the other containing "BAR".
If you send "FOO" and then "BAR" over TCP, no message boundary is
preserved. The other end might get "FOO" and then "BAR". Or it might get
"FOOBAR". Or it might get "F" and then "OOB" and then "AR"
SCTP Services :
Full- Duplex Communication :
SCTP provides full-duplex service ( the data can flow in both directions at the
same time).
Reliability
SCTP uses an acknowledgement mechanism to check the arrival of data.
Note:
UDP is connectionless and unreliable; TCP and SCTP are connection oriented
and reliable.
Multihoming
(one connection and multiple IP addresses)
Multihoming is the practice of connecting a computer network to more than
one network. This can be done in order to increase reliability(if a single link
fails, packets can still be routed through the remaining networks).because if
one network goes down, another network quickly takes over. Multihoming
allows both sender and receiver to define multiple IP addresses for
communication. But, only one of these can be defined as primary address and
the remaining can be used as alternative addresses.
Port numbers:
A frame in data link layer needs a destination MAC address(physical) for
delivery and a source MAC address for destination’s reply. A packet in the
network layer needs a destination IP address(logical) for delivery and a source
IP address for the destination's reply.
At the transport layer, we need a transport layer address, called a port
number. The destination port number is needed for delivery; the source port
number is needed for the reply. In the Internet model, the port numbers are
16-bit integers between 0 and 65,535.
The lANA (Internet Assigned Number Authority) has divided the port numbers
into three ranges: well known, registered, and dynamic (or private)
Well-known ports. The ports ranging from 0 to 1023 are registered and
controlled by lANA.
Registered ports. The ports ranging from 1024 to 49,151 are not
controlled by lANA. They can only be registered with lANA .
Dynamic ports. The ports ranging from 49,152 to 65,535 are neither
controlled nor registered. They can be used by any process.
Socket
Process-to-process delivery needs IP address and the port number at each end
to make a connection. The combination of an IP address and a port number is
called a socket address. Client socket defines the client process uniquely
.server socket address defines the server process uniquely. A transport layer
needs both server socket address and client socket address. ip header contain
ip address. The udp and tcp header contains the port numbers.
Note:
The data link layer is responsible for delivery of frames between two
neighbouring nodes over a link. This is called node-to-node delivery.
The network layer is responsible for delivery of packets between two hosts.
This is called host-to-host delivery.
The transport layer is responsible for delivery of segments between two
processes (applications programs). This is called process-to-process delivery.
Connectionless Service
In a connectionless service, the packets are sent from one party to another with
no need for connection establishment or connection release. The packets are not
numbered; they may be delayed or lost or may arrive out of sequence. There is
no acknowledgment either.
Connection~Oriented Service
Important Functions:
File transfer access and management
Mail Services
We divide connecting devices into five different categories based on the layer
A device which operate below the physical layer is called passive hub.
A device which operate at the physical layer is called repeater or an
active hub.
A device which operate at the physical and data link layers is called
bridge or two-layer switch
A device which operate at the physical, data link, and network layers is
called router or three-layer switch.
A device which can operate at all five layers is called gateway.
Passive Hubs:
A passive hub is a device that operates below the physical layer. A passive hub
is just a connector. It connects the wires coming from different station. In a
star-topology , a passive hub is a point where the signals coming from different
stations ; Collision may occur at hub.
Repeaters
A repeater is a device that operates only in the physical layer. A repeater
receives a signal and regenerates the original bit pattern before it corrupted.
Then it sends the refreshed signal. A repeater can extend the physical length of
a LAN.
Active Hubs
An active Hub is a device that operates only in the physical layer. It is actually a
multipart repeater. It is normally used to create connections between stations
in a star topology.
Bridges
A bridge operates in both the physical and the data link layer. As a physical
layer device, it regenerates the signal . As a data link layer device, the bridge
can check the MAC addresses (source and destination) contained in the frame.
Two layer Switch
We have two-layer switches and three-layer switches. The two-layer switch
performs at the physical and data link layers. A two-layer switch is a bridge
with many ports. It’s design allows better performance. A bridge with a few
ports can connect a few LANs together. A bridge with many ports may be able
to allocate a unique port to each station.
Routers
A router perform at physical ,data-link, and network layer. it’s three layer
[Link] routes the packets based on their logical addresses. A router normally
connects LANs and WANs in the Internet and it has a routing table which is
used for routing. It is used to transfer information from the source to the
destination
SWITCHING
A network is a set of connected devices. Whenever we have
multiple devices, we have The problem of how to connect them to make one-
to-one communication possible. One solution is to make a point-to-point
connection between each pair of devices (a mesh Topology). These methods,
however, are impractical and wasteful when applied to very large networks. A
better solution is switching. A switched network contain of a series of
interlinked Nodes, called switches. Switches are devices used for creating
temporary connections between two or more devices
Two types of Switched networks available.
Circuit switched networks
Packet switched networks
CIRCUIT-SWITCHED NETWORKS:
A circuit-switched network consists of a set of switches connected by physical
links. Usually, Circuit switching takes place at the physical layer. A connection
between two stations is a dedicated [Link] connection uses only one link
Example: traditional telephone network uses the circuit-switching approach.
Packet switching:
In data communications, we need to send messages from
one system to another. In packet-switched network, message divided into
packets of fixed or variable [Link] packets are sent out to the network
sequentially one at a time. In packet switching, there is no resource allocation
for a packet.
Resources are allocated on demand. The allocation is done on a first come,
first-served basis. Example: internet based on the packet switching.
Conceptual questions:
What is a Firewall?
Firewall is a network security system that is used to protect computer
networks from unauthorized access. It prevents malicious access from outside
to the computer network and provide limited access to outside users
What is DNS?
Answer: Domain Name Server (DNS).we can call it an Internet’s phone book.
All the public IP addresses and their hostnames are stored in the DNS .
For a human being, it is easy to remember and recognize the domain name,
however, the computer is a machine that does not understand the human
language and they only understand the machine language .
There is a “Central Registry” where all the domain names are stored and it gets
updated on a periodic basis. All Internet service providers and different host
companies usually interact with this central registry to get the updated DNS
details.
For Example, When you type a website [Link], then
your Internet service provider looks for the DNS associated with this domain
name and translates this website command into a machine language – IP
address – [Link] (note that, this is the imaginary IP address and not
the actual IP for the given website) so that you will get redirected to the
appropriate destination.
This process is explained in the below diagram:
What are IP classes and how can you identify the IP class of given
an IP address?
Classes used to cluster the IP address in to 5 different classes
A URL may contain a request to HTML, image file or any other type.
If the content of the typed URL is in the cache and fresh, then display the
content.
Else find the IP address for the domain so that a TCP connection can be set up.
Browser does a DNS lookup.
Browser needs to know the IP address for a URL so that it can set up a TCP
connection. This is why browser needs DNS service. The browser first looks for
URL-IP mapping browser cache, then in OS cache. If all caches are empty, then
it makes a recursive query to the local DNS server. The local DNS server
provides the IP address.
Browser sets up a TCP connection using three-way handshake.
Browser sends a HTTP request.
Server has a web server like Apache, IIS running that handles incoming HTTP
request and sends an HTTP response.
Browser receives the HTTP response and renders the content.
What is DHCP, how does it work?
The idea of DHCP (Dynamic Host Configuration Protocol) is to enable devices to
get IP address without any manual configuration.
The device sends a broadcast message saying “I am new here”
The DHCP server sees the message and responds back to the device and
typically allocates an IP address. All other devices on network ignore the
message of the new device as they are not DHCP server.
In Wi-Fi networks, Access Points generally work as a DHCP server.
What is ARP, how does it work?
ARP stands for Address Resolution Protocol. ARP is used to find LAN address
from the Network address. A node typically has destination IP to send a packet,
the nodes need link layer address to send a frame over a local link. The ARP
protocol helps here.
The node sends a broadcast message to all nodes saying what is the MAC
address of this IP address.
Node with the provided IP address replies with the MAC address.
Simple Mail Transfer Protocol (SMTP)
Email is emerging as one of the most valuable services on the internet today.
Most of the internet systems use SMTP as a method to transfer mail from one
user to another. SMTP is a push protocol and is used to send the mail whereas
POP (post office protocol) or IMAP (internet message access protocol) are used
to retrieve those mails at the receiver’s side.
SMTP Fundamentals
SMTP is an application layer protocol. The client who wants to send the mail
opens a TCP connection to the SMTP server and then sends the mail across the
connection. The SMTP server is always on listening mode. As soon as it listens
for a TCP connection from any client, the SMTP process initiates a connection
on that port (25). After successfully establishing the TCP connection the client
process sends the mail instantly.
SMTP Protocol
The SMTP model is of two type :
End-to- end method
Store-and- forward method
The end to end model is used to communicate between different organizations
whereas the store and forward method are used within an organization. A
SMTP client who wants to send the mail will contact the destination’s host
SMTP directly in order to send the mail to the destination. The SMTP server
will keep the mail to itself until it is successfully copied to the receiver’s SMTP.
The client SMTP is the one which initiates the session let us call it as the client-
SMTP and the server SMTP is the one which responds to the session request
and let us call it as receiver-SMTP. The client- SMTP will start the session and
the receiver-SMTP will respond to the request.
FTP
FTP stands for File transfer protocol.
FTP is a standard internet protocol provided by TCP/IP used for transmitting
the files from one host to another.
It is mainly used for transferring the web page files from their creator to the
computer that acts as a server for other computers on the internet.
It is also used for downloading the files to computer from other servers.
Objectives of FTP
It provides the sharing of files.
It is used to encourage the use of remote computers.
It transfers the data more reliably and efficiently.
Why FTP?
Although transferring files from one system to another is very simple and
straightforward, but sometimes it can cause problems. For example, two
systems may have different file conventions. Two systems may have different
ways to represent text and data. Two systems may have different directory
structures. FTP protocol overcomes these problems by establishing two
connections between hosts. One connection is used for data transfer, and
another connection is used for the control connection.
Simple Network Management Protocol (SNMP) :
SNMP is an application layer protocol which uses UDP port number
161/[Link] is used to monitor network, detect network faults and
sometimes even used to configure remote devices.
File Transfer Protocol (FTP): File Transfer Protocol(FTP) is an application layer
protocol which moves files between local and remote file systems. It runs on
the top of TCP, like HTTP. To transfer a file, 2 TCP connections are used by FTP
in parallel: control connection and data connection.
Hypertext Transfer Protocol (HTTP): is an application-level protocol that uses
TCP as an underlying transport and typically runs on port 80. HTTP is a stateless
protocol i.e. server maintains no information about past client requests.
Fragmentation vs segmentation:
Fragmentation is associated with IP whereas Segmentation is associated
with TCP.
First of all let us consider Segmentation : Suppose an application say wants to
send some data of say size 5MB. Now this data has to pass through the TCP/IP
stack so that it can can get delivered to the destination. The TCP/IP stack
consists of the following layers : Application , Transport , Internet and Physical
Network Layer. Now the Application layer is the one passing the data to the
next layers. When the data reaches the Transport layer, the datagram that is
produced by the Transport layer has some maximum size limit know as
Maximum Segment Size (MSS), i.e., the size of the datagram in Transport Layer
cannot exceed this size limit, and if a datagram from application layers arrives
to the Transport layer with a size greater than the Transport Layer Datagram
size, then what it does is, it splits the datagram into small size packets such
that the new size is equal to or less than the size of the TL Datagram, and as
such multiple datagrams are generated out of a given datagram. This is nothing
but Segmentation, Segmenting the data sent by Application Layer into smaller
size datagrams.
Same is the case with the Internet Layer. Datagram sent by Transport Layer to
the Internet Layer need to get further down the TCP/IP stack and as such
needs to get into the Physical Network Layer. Now the amount of data that can
be sent through the Physical Layer is also based on the type of medium that is
being used. Maximum Transmission Unit is the factor that defines how many
bytes of data that can be sent through the Physical Layer Medium. So if the
datagram at the Internet Layer has a size greater than the MTU, and if the Do
Not Fragment Bit in the IP Datagram is off, in that scenario the datagram will
be fragmented, i.e. it will be split into smaller size IP Datagrams. And if the Do
Not Fragment Flag is turned On in the IP Datagram , then an ICMP Error
message will be delivered to the sender, as the Internet Layer would have to
drop the datagram. This is Fragmentation in the Internet Layer.
With