What is OSI model?
OSI model has 7 layers:
- Application layer (layer 7)
- Presentation layer (layer 6)
- Session layer (layer 5)
- Transport layer (layer 4)
- Network Layer (layer 3)
- Data Link layer (layer 2)
- Physical layer (layer 1)
If you are fresher, then most of the time interviewer will ask OSI model questions from you. So, prepare well before going to the interview, check out the OSI model detailed article.
As we saw above OSI model has 7 layers, while the TCP/IP model has 5 layers. In TCP/IP model first three layers of the OSI model (application layer, presentation layer and session layer) are merged and resulted layer is known as the application layer only.
The transport layer and physical layer are the same in both models.
Network layer of the OSI model is replaced by the Internet layer.
The data link layer is replaced by the Network interface layer.
- Application layer
- Transport layer
- Internet Layer
- Network Interface layer
What is the difference between TCP and UDP?
TCP and UDP both are transport layer protocol; both are responsible for transmission of data.
1. TCP stands for transmission control protocol.
2. TCP is connection oriented; it means before start transmission, a connection is established between sender and receiver.
3. TCP is reliable protocol. In TCP protocol, receiver sends an acknowledge to the sender when any packet is lost to retransmit the packet.
4. TCP is used in secure application transmission. Example: web browsing and E-mail.
5. TCP header size is 20 bytes.
1. UDP stands for User datagram protocol.
2. UDP is connectionless protocol.
3. UDP is unreliable, there is no acknowledge, if a packet is lost, it means packet is lost.
4. UDP is used in VoIP application. (VoIP stands for voice over internet).
5. UDP header size is 8 bytes.
Explain TCP 3-way handshake process?
In TCP protocol, before data transmission a connection is established. To establish, this connection there is a 3-way handshake process.
First, the Client sends a syn message to the server.
Then, in the response of syn message, the server sends a syn/ack message to the client.
Now, again client sends an ack message to the server in the response of syn/ack message.
Here syn stands for synchronise and ack stands for acknowledge.
In the whole process, there are 3 messages that client and server exchanged to form a connection.
- Syn/ack message
- ack message
What is ARP? How it works?
ARP stands for address resolution protocol. ARP is used to know the MAC address of the device.
There are two ARP messages-
1. ARP request
ARP request is broadcast in nature when a host sends an ARP request, it first goes to the switch, as host is connected via a switch, then switch broadcasts the message to all devices in the network, then all devices check the IP address field and drop the frame, only one host accept the message whose IP address is matched with that IP address.
2. ARP reply:
In the response of ARP request, device sends an ARP reply. It is unicast in nature.
How many types of ARP are there?
There are 5 types of ARP :
- Normal ARP
- Reverse ARP
- Inverse ARP
- Proxy ARP
- Gratuitous ARP
What is the full form and default size of MTU?
MTU stands for maximum transmission unit. The default size of MTU is 1500 bytes.
DHCP stands for Dynamic Host Configuration Protocol. The DHCP server assigns IP addresses automatically to the hosts. In a smaller network, there is no need to configure a DHCP server, you can manually configure IP address. But in a larger network, you can’t assign IP addresses manually, it is a time-consuming job.
Explain DORA process?
When a host gets an IP address through a DHCP server, there are 4 messages that DHCP server and client send each other to communicate. The word, DORA came from the combination of the first alphabet of these messages (D for Discover, O for offer, R for request, A for acknowledge).
Discover: DHCP client sends this message to discover the DHCP server.
Offer: DHCP server sends this message to the client. In this message, the server sends an IP address.
Request: DHCP client sends this message to the server, to convey the message that I am Ok with the IP address that you sent me in the offer message and now please send the IP address and other configuration details (like default gateway address and DNS server address).
Acknowledge: This message is sent by the DHCP server. In this message, the server sends IP address along with the configuration.
So, the DHCP client sends 2 messages: discover and Request. And DHCP server sends offer and acknowledge message.
STP stands for spanning tree protocol. STP is used to reduce layer 2 loops. In general, we add extra links to assure 24/7 network availability. These extra links are also known as redundant links.
The purpose of adding redundant links is that if any active link fails due to some problem, then these links act as active links (backup links). So, this way, you can understand redundant links are good.
But these extra links also form layer 2 loops, which is not good. Because layer 2 loops are responsible for the broadcast storm.
Difference between router and firewall?
Router: Router is a layer 3 device. The primary function of a router is to forward the packets. Router is used to connect the 2 different networks. Router doesn’t perform filtering if there is no ACL configuration inside the router.
Firewall: Firewall is a filtering device that allows or denies the traffic based on the filtering rule. Firewall is used to secure the LAN networks from outer attacks.
How many bits are in IPv6 address?
IPv6 is 128 bits address and IPv4 is 32 bits address.
What is OSPF?
OSPF stands for open shortest path first. OSPF is a dynamic protocol. It is an interior gateway routing protocol. Here dynamic protocol means, it learns routes dynamically, there is no need to configure manual routes.
OSPF works on Dijkstra algorithm, also known as shortest path first algorithm (SPF).
How many states are in OSPF?
There are 7 states in OSPF.
- Down state
- Init State
- 2-way state
- Ex start state
- Exchange State
- Loading State
- Full State
How many states are in OSPF?
There are 5 messages in OSPF.
- Hello message
- DBD message (database description)
- LSR (Link State Request) message
- LSU (Link State Update) message
- LSACK(Link State Acknowledge) message
Initially routers send hello message to directly connected routers. In hello message routers send their router id. When 1 side hello message is sent, this is an init state. When both side hello message are exchanged that state is called as a 2-way state.
After the successful exchange of hello messages, neighborship form.
DBD message: After becoming neighbors, both routers send DBD summary to synchronize LSDB data.
Router compares their link-state database with DBD summary and then sends a request message to the neighbor to send the details of missing routes.
LSU message: In the response to the LSR message, the neighbor sends requested routes in the LSU message.
This is a acknowledge message, it doesn’t carry any useful information, it is just to confirm the neighbor that I successfully received LSU data. When both routers have the same LSDB, then adjacency will form.
How many states are in OSPF?
For static value, AD value is 1. Many times, interviewer directly ask AD value for different routes.
Here is the table
Directly connected route
What is port number of HTTP?
HTTP port number is 80.
Here are the commonly asked port number ccna question.
Explain static address and dynamic address?
When we configure IP address manually, then we use term static address, this address will not change until we will not change the configuration manually.
When a host gets IP address from DHCP server, address changes with time. This is called as dynamic address.