OSI Layer Model
OSI Layer Model
OSI is the Open Systems Interconnection is a reference model which defines the standards of
communication between the computer systems/applications over the network. It is not implemented in
the real world but taken as the reference to how computers communicate with each other using
various protocols defined in each layer. There are 7 layers in the OSI model.
3. Is there any other alternative model to the OSI model? If yes, explain it.
We have TCP/IP as an alternate model which also explains the standards of communication between
computers/application over the network. It is a much more simple model as compared to the OSI
layer model and also contains fewer details of protocols than the OSI model.
TCP/IP model has 4 layers whereas the OSI model is 7 layer architecture model. The 4 layers
of the TCP/IP model are Application Layer, Transport Layer, Internet Layer, Network Access
Layer.TCP-IP Model vs OSI Model
7. Network Layer
Page |1
CCNA CCNA [email protected]/ +91 9493679209
2
8. Transport Layer
Half-Duplex: In half-duplex data can travel in both directions but not at the same time. Either device
can send the data or can receive the data at a single point of time.
Full-Duplex: In Full-Duplex scenario, Data can travel in both direction at the same time. Data can
travel in both directions simultaneously.
11. Explain the difference between Flow Control and Error Control?
Flow Control: Flow Control is the function of adjusting the flow of data from one device to another
device in between adjacent OSI layers. It is used for ensuring that receiving device can handle all
incoming data. It is particularly used when sending device is capable of transmitting the data as a
much faster rate as compared to receiving a device.
Error Control: Error Control is the process of detecting and controlling the errors which arrive during
the transformation of data both the bit level and packet level errors.
During the transformation of data from one computer/application to another involves many steps,
each step can subject to error. With the Error Detection and Error Control process we can be that the
transmitted and received data is identical.
12. List the different protocols works at each layer of the OSI model?
Page |2
CCNA CCNA [email protected]/ +91 9493679209
3
Apple Filing Protocol (AFP), Independent Computing Architecture (ICA), Lightweight Presentation
Protocol(LPP), NetWare Core Protocol(NCP), Network Data Representation(NDR)
Apple Talk Data Stream Protocol (ADSP), Apple Talk Session Protocol (ASP), H.245, Layer 2
Forwarding Protocol (L2F), NetBIOS, PAP, PPTP, RPC, RTCP, SMPP, SCP, SOCKS, ZIP, SDP
TCP, UDP, SST, SPX, SCTP, RUDP, MPTCP, FCP, CUDP, ATP
IPv4, IPv6, RIP, EIGRP, ICMP, IGMP, EGP, DDP, CLNS, IPSec, IPX, PIM
Ethernet, CDP, ATM, ARCnet, CAN, Econet, EAPS, FDDI, Frame Relay, HDLC, LAPD, LLDP, PPP,
NDP, SpaceWire, Token Ring, MPLS
7. Physical Layer:
13. What is Port Number and Define the Range of Port Numbers?
A port number is a unique identification 16-bit unsigned number that is put in a header appended to a
message unit. They identify a specific process or network services.
When any message is received by the server or endpoints, it needs the mechanism to identify
for forwarding the message to right process, to identify the process we use the Port Numbers.
When data is transfer from the higher layer to the lower layer. Each layer adds its header to the
original packet. This is known as Data Encapsulation.
When data is transferred from the lower layer to the higher layer, each layer removes the information
added by the other layers. It will remove the headers added by other layers and will insert its own
Page |3
CCNA CCNA [email protected]/ +91 9493679209
4
header. This is known as Data de-encapsulation.
CRC is Cyclic Redundancy Check. It is used to detect errors in a network. It works at Data Link
Layer.
16. What is TCP Three-Way Handshake?
A TCP Three-way Handshake is a method to establish a connection between the client/localhost and
server. It has three steps in which client and server exchange their SYN and ACK packets before
data transfer take place. For Further Reading Please visit below Links:
The data link layer is also responsible for logical link control, media access control, hardware addressing,
error detection and handling and defining physical layer standards. It provides reliable data transfer by
transmitting packets with the necessary synchronization, error control and flow control.
The network layer is responsible for packet forwarding including routing through intermediate routers, since
it knows the address of neighboring network nodes, and it also manages quality of service (qos), and
recognizes and forwards local host domain messages to the transport layer (layer4).
2. Error recovery,
3. Flow control,
5. Congestion avoidance
Routers operate on the third layer of the osi model, the network-control layer. Rather than passing packets
based on the media access control (mac) layer addresses (as bridges do), a router examines the packet's data
structure and determines whether or not to forward it.
A switch works at layer 2 of the osi model (data-link). It is a lan device that can also be called a multi-port
bridge. A switch switches ethernet frames between ethernet devices. Switches do not care about ip addresses
nor do they even examine ip addresses as the frames flow through the switch.
A window refers to the number of segments that is allowed to be sent from source to destination before an
acknowledgement is sent back.
8. What is the role of the llc sub layer in data link layer?
18.
The logical link control (llc) data communication protocol layer is the upper sub-layer of the data link
layer (which is itself layer 2, just above the physical layer) in the seven-layer osi reference model. It
provides multiplexing mechanisms that make it possible for several network protocols (ip, ipx) to
coexist within a multipoint network and to be transported over the same network media, and can
also provide flow control mechanisms.
The llc sub-layer acts as an interface between the media access control (mac) sublayer and the
network layer.
As the ethertype in an ethernet ii framing formatted frame is used to multiplex different protocols on
top of the ethernet mac header it can be seen as llc identifier.
Multiplexing protocols transmitted over the mac layer (when transmitting) and decoding them (when
receiving).
The protocol used for llc in ieee 802 networks, such as ieee 802.3/ethernet (if the ethertype field isn't
used), ieee 802.5, and ieee 802.11, and in some non-ieee 802 networks such as fddi, is specified by the
ieee 802.2 standard.
Some non-ieee 802 protocols can be thought of as being split into mac and llc layers. For example,
while hdlc specifies both mac functions (framing of packets) and llc functions (protocol multiplexing,
flow control, detection, and error control through a retransmission of dropped packets when
indicated), some protocols such as cisco hdlc can use hdlc-like packet framing and their own llc
protocol.
Another example of a data link layer which is split between llc (for flow and error control) and mac
(for multiple access) is the itu-t g.hn standard, which provides high-speed local area networking over
existing home wiring (power lines, phone lines and coaxial cables).
Page |5
CCNA CCNA [email protected]/ +91 9493679209
6
An llc header tells the data link layer what to do with a packet once a frame is received. It works like
this: a host will receive a frame and look in the llc header to find out where the packet is destined for -
for example, the ip protocol at the network layer or ipx.
The gprs llc layer also does ciphering and deciphering of sn-pdu (sndcp) packets.
The application layer is a layer in the open systems interconnection (osi) seven-layer model and in
the tcp/ip protocol suite. It consists of protocols that focus on process-to-process communication
across an ip network and provides a firm communication interface and end-user services.
23 telnet
139 netbios
Dns and some other services work on both the protocols. We will take an example of dns service. Two
protocols are somewhat different from each other. Tcp is a connection-oriented protocol and it
requires data to be consistent at the destination and udp is connection-less protocol and doesn't
Page |6
CCNA CCNA [email protected]/ +91 9493679209
7
require data to be consistent or don't need a connection to be established with host for consistency of
data.
20.
Udp packets are smaller in size. Udp packets can not be greater then 512 bytes. So any application
needs data to be transferred greater than 512 bytes require tcp in place. For example, dns uses both
tcp and udp for valid reasons described below. Note that udp messages are not larger than 512 bytes
and are truncated when greater than this size. Dns uses tcp for zone transfer and udp for name
queries either regular (primary) or reverse. Udp can be used to exchange small information whereas
tcp must be used to exchange information larger than 512 bytes. If a client doesn't get response from
dns it must re-transmit the data using tcp after 3-5 seconds of interval.
There should be consistency in dns zone database. To make this, dns always transfer zone data using
tcp because tcp is reliable and make sure zone data is consistent by transferring the full zone to other
dns servers who has requested the data.
The problem occurs when windows 2000 server and advanced server products uses dynamic ports
for all above 1023. In this case your dns server should not be internet facing i.e. Doing all standard
queries for
client machines on the network. The router (acl) must permitted all udp inbound traffic to access any
high udp ports for it to work.
Ldap always uses tcp - this is true and why not udp because a secure connection is established
between client and server to send the data and this can be done only using tcp not udp. Udp is only
used when finding a domain controller (kerberos) for authentication. For example, a domain client
finding a domain controller using dns.
Network layer
Transport layer
21.
22. 15. Give some example for protocols work at application layer?
Bgp,dhcp,dns ftp http imap ldap mgcp nntp ntp pop onc/rpc rtp rtsp rip sip smtp snmp ssh telnet
tls/ssl xmpp
A cyclic redundancy check (crc) is an error-detecting code commonly used in digital networks and
storage devices to detect accidental changes to raw data. Blocks of data entering these systems get a
short check value attached, based on the remainder of a polynomial division of their contents. On
retrieval, the calculation is repeated and, in the event the check values do not match, corrective action
can be taken against data corruption.it work on data link layer
Page |7
CCNA CCNA [email protected]/ +91 9493679209
8
It makes sure the appropriate physical protocol is assigned to the data. The data link layer is the
second layer in the osi model. The three main functions of the data link layer are to deal with
transmission errors, regulate the flow of data, and provide a well-defined interface to the network
layer.
Tcp
20. Which layer provides logical addressing that routers will use for path determination?
Network layer
21. Which layer specifies voltage, wire speed, and pinout cables and moves bits between
devices?
Physical layer
22. Which layer combines bits into bytes and bytes into frames, uses mac addressing, and
provide error detection?
23. Which layer is responsible for keeping the data from different applications separate on the
network?
24. Which layer segments and resembles data into a data stream?
Transport layer
25. Which layer provides the physical transmission of the data and handless error notification,
network topology, and flow control?
26. Which layer manages device addressing, tracks the location of devices on the network,
and determines the best way to move data?
Network layer
27. How data breaks down on each layer from top to bottom?
Application Data
Presentation Data
Page |8
CCNA CCNA [email protected]/ +91 9493679209
9
Session Data
Transport Segment
Network Packet
Physical Bits
28. Mac address works on which layer? What are the differences of mac sub layer and llc sub
layer?
29. Which layer is responsible for converting data packets from the data link layer into
electrical signals?
Physical layer
30. At which layer is routing implemented, enabling connections and path selection between
two end systems?
Network layer
31. Which layer defines how data is formatted, presented, encoded, and converted for use on
the network?
Presentation layer
32. Which layer is responsible for creating, managing and terminating sessions between app?
The session layer sets up, maintains, and terminates sessions between applications.
Dns queries consist of a single udp request from the client followed by a single udp reply from the server.
The transmission control protocol (tcp) is used when the response data size exceeds 512 bytes, or for
tasks such as zone transfers. Some resolver implementations use tcp for all queries.
Application layer
Forward dns lookup is used to convert the human meaningful name (domain name) which is in easy to
understand format to computer meaningful name (ip address), however reverse dns lookup works in
reverse way to convert ip address to domain name.
Ipsec is an internet engineering task force (ietf) standard suite of protocols that provides data
authentication, integrity, and confidentiality as data is transferred between communication points across
ip networks. Ipsec provides data security at the ip packet level.
Page |9
CCNA CCNA [email protected]/ +91 9493679209
10
37. What is the way to establish a tcp connection?
The tcp three-way handshake intransmission control protocol (also called the tcp-handshake; three
message handshake and/or syn-syn-ack) is the method used by tcp set up a tcp/ip connection over
aninternet protocol based network. Tcp's three way handshaking technique is often referred to as "syn-
syn-ack" (or more accurately syn, syn-ack, ack) because there are three messages transmitted by tcp to
negotiate and start a tcp session between twocomputers. The tcp handshaking mechanism is designed so
that two computers attempting to communicate can negotiate the parameters of the network tcp socket
connection before transmitting data such as ssh and http web browser requests.
This 3-way handshake process is also designed so that both ends can initiate and negotiate separate tcp
socket connections at the same time. Being able to negotiate multiple tcp socket connections in both
directions at the same time allows a single physical network interface, such as ethernet, to bemultiplexed
to transfer multiple streams of tcp data simultaneously.
38. What is the difference between flow control and error control?
Flow control and error control are the control mechanism at data link layer and transport layer.
Whenever the sends the data to the receiver these two mechanisms helps in proper delivering of the
reliable data to the receiver. The main difference between the flow control and error control is that the
flow control observes the proper flow of the data from sender to receiver, on the other hand, the error
control observes that the data delivered to the receiver is error free and reliable.
If you are looking for a Network Engineer, Network Administrator or any other IT
administrator job. OSI model is one the most common topic for the interviewer to ask you.
Today I am going to cover-up most of the interview questions related to OSI model.
Ans:- Check my article The OSI Model’s Seven Layers Defined and Functions Explained
TCP (Transmission Control Protocol) is a set of rules (protocol) used along with the Internet
Protocol (IP) to send data in the form of message units between computers over the
Internet. While IP takes care of handling the actual delivery of the data, TCP takes care of
keeping track of the individual units of data (called packets) that a message is divided into
for efficient routing through the Internet.
TCP provides end-to-end reliability between the application process running on one
computer system to another computer system by adding services on top of IP.
• Data Transfer
• Reliability
P a g e | 10
CCNA CCNA [email protected]/ +91 9493679209
11
• Connections
• Flow Control
• Precedence and security
• Multiplexing
How it Works:-
There are four distinct elements that uniquely identify a TCP connection. They are:-
The standard TCP Header is defined in RFC 791 and the TCP packet structure is illustrated
as below picture:-
P a g e | 11
CCNA CCNA [email protected]/ +91 9493679209
12
The TCP header is 20 bytes long, or up to 24 bytes with options. You need to understand
each field in the TCP segment is:-
Source Port:- The port number of the application on the host sending the data.
Destination port:- The port number of the application requested on the destination host.
Sequence Number:- A number used by TCP that puts the data back in the correct order or
re-transmits missing or damaged data, a process called sequencing.
Header length:- The number of 32-bit words in the TCP header. This indicates where the
data begins. The TCP header (Even one including options ) is an integral number of 32-bits
in length.
Checksum:-The cyclic redundancy check (CRC), because TCP doesn’t trust the lower layers
and checks everything. The CRC checks the header and data fields.
Urgent:- A valid field only if the urgent pointer in the code bits is set. If so, this value
indicates the offset from the current sequence number, in octets, where the first segment of
non-urgent data begins.
Data:- Handed down to the TCP protocol at the Transport layer, which includes the Upper
layer headers.
You can easily view all the TCP header information with Wireshark.
P a g e | 12
CCNA CCNA [email protected]/ +91 9493679209
13
Error Recovery:-
Also known as reliability, TCP provides error recovery during data transfer sessions between
two end devices who have established a connection. The sequence and acknowledgment
fields in the TCP header are used to track every byte of data transfer and ensure that
missing bytes are retransmitted.
In below image, the Acknowledgment field sent by the web client (4000) implies the next
byte to be received; this is called forward acknowledgment.
Flow Control:-
Flow control is handled by TCP through a process called windowing. The two end devices
negotiate the window size when initially establishing the connection; then they dynamically
renegotiate window size during the life of the connection, increasing its size until it reaches
the maximum window size of 65,535 bytes or until errors occur. The window size is
specified in the window field of
P a g e | 13
CCNA CCNA [email protected]/ +91 9493679209
14
the TCP header. After sending the amount of data specified in the window size, the source
must receive an acknowledgment before sending the next window size of data.
User Datagram Protocol is a protocol that is used at the Transport layer for connectionless,
non-guaranteed communications. Unlike TCP, UDP does not setup a connection and does
not use acknowledgments. UDP is given the Internet Protocol number of 17 and is defined
in RFC 768 .
UDP uses 16-bit port numbers similar TCP. When a UDP packet is sent to a port that is not
listening, it will respond with an ICMP port unreachable message to the packet sender.
Common network applications that use UDP include Domain Name System (DNS),
Streaming Media Applications, Voice over IP, Trival File Transfer Protocol ( TFTP) and online
Games.
The UDP header consists of four 16-bit fields ( 4 * 16), which makes a total of 8-bytes in
total length. The UDP header comes immediately after the IP header. Th details of
individual fields are as follows:-
Source Port:- A 16-bit field whose values can range from 0 to 65,535 specifying the source
port.
P a g e | 14
CCNA CCNA [email protected]/ +91 9493679209
15
Destination Port:- A 16-bit field whose values can range from 0 to 65,535 specifying the
destination port.
Length:- A 16-bit field whose values can range from 0 to 65,535. it is the length of the UDP
header and the UDP data in bytes. The minimum value for this field is 8 bytes.
UDP Checksum:- A 16-bit field whose values can range from 0 to 65,535. The UDP
checksum covers the UDP header and the UDP data. With UDP the checksum is optional,
while the TCP it is mandatory.
TCP UDP
Sequenced Unsequenced
Reliable Unreliable
Connection-oriented Connectionless
Acknowledgments No Acknowledgments
P a g e | 15
CCNA CCNA [email protected]/ +91 9493679209
16
would be the end of the
relationship.
Examples HTTP, HTTPs, FTP, SMTP DNS, DHCP, TFTP, SNMP, RIP,
Telnet etc… VOIP etc…
Ordering of data TCP rearranges data packets UDP has no inherent order as
packets in the order specified. all packets are independent of
each other. If ordering is
required, it has to be
managed by the application
layer.
Speed of transfer The speed for TCP is slower UDP is faster because there is
than UDP. no error-checking for packets.
Header Size TCP header size is 20 bytes UDP Header size is 8 bytes.
Data Flow Control TCP does Flow Control. TCP UDP does not have an option
requires three packets to set for flow control
up a socket connection
before any user data can be
sent. TCP handles reliability
and congestion control.
Error Checking TCP does error checking UDP does error checking, but
no recovery options.
DNS:- DNS uses TCP for Zone exchanges between server and UDP when a client is trying
to resolve a hostname to an IP-address.
LDAP:- LDAP always uses TCP – this is true and why not UDP because a secure connection
is established between client and server to send the data and this can be done only using
TCP, not UDP. UDP is only used when finding a domain controller (Kerberos) for
authentication. For example, a domain client finding a domain controller using DNS.
(Q) Which layer is responsible for converting data packets from the Data Link layer into electrical signals?
Explanation:- The Physical layer takes frames from the Data Link Layer and encodes the 1s
and 0s into a digital signal for transmission on the network medium.
(Q) At which layer is routing implemented, enabling connections and path selection between two end
systems. ?
P a g e | 17
CCNA CCNA [email protected]/ +91 9493679209
18
Ans:- Network Layer
Explanation:- The Network layer provides routing through an inter-network and logical
addressing.
(Q) Which layer defines how data is formatted, presented, encoded, and converted for use on the
network?
Explanation:- The Presentation layer makes sure that data is in a readable format for the
application layer.
(Q) Which layer is responsible for creating, managing and terminating sessions between applications?
Ans:- Session
Explanation:- The Session layer setup, maintains and terminates session between
applications.
(Q) Which layer provides logical addressing that routers will use for path determination?
Explanation:- The Network layer provides logical addressing, typically IP addressing and
routing.
(Q) Which layer specifies voltage, wire speed, and pinout cables and moves bits between devices?
Explanation:- The Physical layer is responsible for the electrical and mechanical connections
between devices.
(Q) Which layer combines bits into bytes and bytes into frames, uses MAC addressing, and provide error
detection?
Explanation:- The Data-link layer is responsible for the framing of data packets.
(Q) Which layer is responsible for keeping the data from different applications separate on the network?
Explanation:- The Session layer creates sessions between different host applications.
(Q) Which layer segments and resembles data into a data stream?
P a g e | 18
CCNA CCNA [email protected]/ +91 9493679209
19
Ans:- Transport
(Q) Which layer provides the physical transmission of the data and handless error notification, network
topology, and flow control?
(Q) Which Layer manages device addressing, tracks the location of devices on the network, and
determine the best way to move data?
(Q) How Data breaks down on each layer from top to bottom?
Ans:- Data encapsulation is the process that takes place when one host on a network needs
to send data to another host. As data is prepared for transit, it flows down through each
layer of the OSI model. At each layer, extra control information is added to the data before
being passed to the layer below. This process continues until the data reaches the physical
layer where the data is passed onto the network medium as a series of 0’s and 1’s.
P a g e | 19
CCNA CCNA [email protected]/ +91 9493679209
20
DNS is using both TCP and UDP protocol. TCP for Zone exchanges between server
and UDP when a client is trying to resolve a hostname to an IP-address.
(Q) What are the differences between OSI and TCP/IP model?
P a g e | 20
CCNA CCNA [email protected]/ +91 9493679209
21
LLC sublayer(802.2):- responsible for identifying different protocol logically & encapsulate
them.
P a g e | 21
CCNA CCNA [email protected]/ +91 9493679209
22
P a g e | 22