Interview Question on OSI Layer Model

Define OSI layers

OSI stands for Open System Interconnection. OSI model helps networking professionals in understanding information flow from one source to destination. 

Remember, all devices and software applications use the OSI model to explain data flow between source and destination.


What is a layer?

Layer is a completely logical partition of PDU (protocol data unit) process. That define how the information travels from one computer to another over the network.


Top down of OSI layer model sequence name

7 Layers of the OSI Model



Layer 

Functions

Data 

Unit

Addresses

Devices

Protocols

DoD 

Model

Host Layers

Application Layer 

Network process application

APDU


Firewalls, gateways, PC

HTTP, DNS, SNMP, Telnet, FTP

Process

Presentation Layer

Data presentation, encryption-decryption, convert machine dependent data to machine independent data

PPDU



SSL, TLS, ASCII

Session Layer

Interhost communication, managing sessions between applications

SPDU



NetBios, PPTP

Media Layers

Transport Layer

Reliable delivery of packets between points on a network

Segment

Port 


TCP, UDP

Host to Host

Network Layer

Addressing, routing and (not necessarily reliable) delivery of datagram between points on a network

Packet

IP

Routers, layer 3 switches

IP, ARP, ICMP, IPSEC

Internet

Data-link Layer

A reliable direct point-to-point data connection

Frame

MAC

Switches, bridges, NICs, encryption devices

PPP, ATM, Ethernet

Network

Physical layer

A (not necessarily) reliable direct point-to-point data connection

Bits

Cables, connectors, NICs, hubs, repeaters, modems

Ethernet, USB, Bluetooth, IEEE 802.11


OSI Model and DOD Model

The OSI Model originally distinguishes between service interval and protocols. The TCP/IP model doesn't clearly distinguish between service interval and protocols.

The OSI model is a reference model. The TCP/IP model is an implementation of the OSI model.

In OSI model, the protocols came after the model was described. In TCP/IP model, the protocols came first, and the model was really just a description of the existing protocols.

In OSI model, the protocols are better hidden. In TCP/IP model, the protocols are not hidden.

The OSI Model has 7 layers. The TCP/IP model has only 4 layers.

The OSI Model supports both connectionless and connection-oriented communication in the network layer, but only connection-oriented communication in transport layer. The TCP/IP model support both connectionless and connection-oriented communication in the transport layer.


What is TCP/IP?

It is commonly known as TCP/IP, because its most important protocols, the Transmission Control Protocol (TCP) and the Internet Protocol (IP), were the first networking protocols defined in this standard. We believe you must have got a gist on types of interview questions you may be asked.


What is IP Stack?

IP Stack is equal to TCP/IP Stack. OSI Layer. 


Difference between TCP and UDP.



TCP

UDP

Acronym for

Transmission Control Protocol

User Datagram Protocol or Universal Datagram Protocol

Connection

Transmission Control Protocol is a connection-oriented protocol.

User Datagram Protocol is a connectionless protocol.

Function

As a message makes its way across the internet from one computer to another.

UDP is also a protocol used in message transport or transfer.

Usage

TCP is suited for applications that require high reliability, and transmission time is relatively less critical.

UDP is suitable for applications that need fast, efficient transmission, such as games. UDP's stateless nature is also useful for servers that answer small queries from huge numbers of clients.

Protocols

HTTP, HTTPs, FTP, SMTP, Telnet

DNS, DHCP, TFTP, SNMP, RIP, VOIP.

Ordering of data packets

TCP rearranges data packets in the order specified.

UDP has no inherent order as 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 than UDP.

UDP is faster because error recovery is not attempted. It is a "best effort" protocol.

Reliability

There is absolute guarantee that the data transferred remains intact and arrives in the same order in which it was sent.

There is no guarantee that the messages or packets sent would reach at all.

Header Size

TCP header size is 20 bytes

UDP Header size is 8 bytes.

Common Header Fields

Source port, Destination port, Check Sum

Source port, Destination port, Check Sum

Streaming of data

Data is read as a byte stream; no distinguishing indications are transmitted to signal message (segment) boundaries.

Packets are sent individually and are checked for integrity only if they arrive.

Weight

TCP is heavy weight. TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control.

UDP is lightweight. There is no ordering of messages, no tracking connections, etc. It is a small transport layer designed on top of IP.

Data Flow Control

TCP does Flow Control. TCP requires three packets to set up a socket connection, before any user data can be sent. TCP handles reliability and congestion control.

UDP does not have an option for flow control

Error Checking

TCP does error checking and error recovery. Erroneous packets are retransmitted from the source to the destination.

UDP does error checking but simply discards erroneous packets. Error recovery is not attempted.

Fields

1. Sequence Number, 2. AcK number, 3. Data offset, 4. Reserved, 5. Control bit, 6. Window, 7. Urgent Pointer 8. Options, 9. Padding, 10. Check Sum, 11. Source port, 12. Destination port

1. Length, 2. Source port, 3. Destination port, 4. Check Sum

Acknowledgement

Acknowledgement segments

No Acknowledgment

Handshake

SYN, SYN-ACK, ACK

No handshake (connectionless protocol)


Some important Port Numbers of Networking.

Common TCP/IP Protocols and Ports


Protocol

Port Number

TCP/UDP

Description

FTP (File Transfer Protocol)

20 & 21

TCP

Used to transfer files between computers over the network or the Internet.

SSH (Secure Shell)

22

TCP

A secure method to access devices via a command line over the network or Internet.

Telnet

23

TCP

Similar to SSH but not secure.

SMTP (Simple Mail Transfer Protocol)

25

TCP

Used to send email from a mail server to a user’s mailbox.

DNS (Domain Name System)

53

TCP/UDP

Translates names to IP addresses on networks and the Internet.

DHCP (Dynamic Host Configuration Protocol)

67 & 68

UDP

Used to assign IP addresses to DHCP enabled devices so they can communicate on the network.

TFTP (Trivial File Transfer Protocol)

69

UDP

An unsecure version of FTP.

HTTP (Hypertext Transfer Protocol)

80

TCP

The protocol used to access web pages on the Internet.

POP3 (Post Office Protocol version 3)

110

TCP

One of the older protocols used to retrieve email from email servers.

NNTP (Network News Transport Protocol)

119


Used for transporting Usenet news articles to NNTP clients.

NTP (Network Time Protocol)

123

UDP

Keeps devices on the network synchronized in regard to their time.

IMAP4 (Internet Message Access Protocol)

143

TCP

A more robust protocol used to retrieve email from email servers.

SNMP (Simple Network Management Protocol)

161 & 162

TCP/UDP

Provides the ability for administrators to monitor and configure SNMP enabled devices remotely.

Border Gateway Protocol (BGP)

179

TCP

BGP version 4 is widely used on the public internet and by Internet Service Providers (ISP) to maintain very large routing tables and traffic processing.

LDAP (Lightweight Directory Access Protocol)

389

TCP/UDP

Allows for access to distributed directory information.

HTTPS (Secure Hypertext Transfer Protocol)

443

TCP

Provides a secure connection to websites using SSL or TLS.

IMAP4 over SSL

993


Allows for the use of IMAP4 over secure connections.

POP3 over SSL

995


Allows for the use of POP3 over secure connections.

RDP (Remote Desktop Protocol)

3389


Used by Windows Terminal Server for remote desktop connections.


What is the Range of Port Numbers?

Well Known Ports - 0 to 1023
Registered Ports - 1024 to 49151
Open Ports      - 49152 to 65535


What is a Protocol Number and give some examples?

In IPV4 There is a Field called Protocol to identify the Next Level Protocol. In IPV6 this Field is called "Next Header" Field. 

Protocol

Protocol Number

ICMP

1

IGMP

2

IPv4

4

TCP

6

EGP

8

IGP

9

UDP

17

IPv6

41

GRE

47

EIGRP

88

OSPF

89

VRRP

112



What is a Window in networking terms?
Window is the amount of segments sent by TCP between two acknowledgements.


What are the differences between the MAC sublayer and LLC sublayer?

MAC sublayer stands for Media Access Control layer.  MAC address works on Layer 2- Data Link Layer. This layer controls the permission of data to transmit.

LLC sublayer stands for Logical Link Control layer. This layer controls frame synchronization, flow control, and error checking.


What is CRC? Which layer CRC works?

Cyclic Redundancy Check is used to detect the errors in network. It works at Data Link Layer (LLC Sub Layer).


What is the difference between flow control and error control?

As the name suggests, flow control is a mechanism to ensure the efficient delivery of Data. Flow control is agreeing on the minimum amount of data that a receiver can handle at a time. While error controls check and correct errors in the data bits and packets.


Which layers perform error detection and flow control?

On receiving and while transmission of information, Layer 2 - Data Link layer decoded and encoded data into bits. This layer is the firmware layer of NIC. It converts datagrams into frames and also adds start and stop flags to each frame.

The data link layer is further divided into two sublayers: The Media Access Control (MAC) layer and the Logical Link Control (LLC) layer. This layer also performs error checking and flow control.


What is Data encapsulation?

Data encapsulation is a process of adding extra information at each layer of the OSI model while information flow from one host to another host. Information such as source and destination address, protocol information, type of data, etc.


What is difference between Data Encapsulation and data de-encapsulation?

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. This is known as Data de-encapsulation.


























0 Comments