What are Unicasting, Anycasting, Multiccasting and Broadcasting?
If the message is sent from a source to a single destination node, it is called Unicasting. This is typically done in networks.
If the message is sent from a source to a any of the given destination nodes. This is used a lot in Content delivery Systems where we want to get content from any server.
If the message is sent to some subset of other nodes, it is called Multicasting. Used in situation when there are multiple receivers of same data. Like video conferencing, updating something on CDN servers which have replica of same data.
If the message is sent to all the nodes in a network it is called Broadcasting. This is typically used in Local networks, for examples DHCP and ARP use broadcasting.
What are layers in OSI model?
There are total 7 layers
1. Physical Layer
2. Data Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
What is Stop-and-Wait Protocol?
In Stop and wait protocol, a sender after sending a frame waits for acknowledgement of the frame and sends the next frame only when acknowledgement of the frame has received.
What is Piggybacking?
Piggybacking is used in bi-directional data transmission in the network layer (OSI model). The idea is to improve efficiency piggy back acknowledgement (of the received data) on the data frame (to be sent) instead of sending a separate frame.
Differences between Hub, Switch and Router?
What happens when you type a URL in web browser?
A URL may contain request to HTML, image file or any other type.
What is DHCP, how does it work?
What is ARP, how does it work?
ARP stands for Address Resolution Protocol. ARP is used to find LAN address from Network address. A node typically has destination IP to send a packet, the nodes needs link layer address to send a frame over local link. The ARP protocol helps here.
If the message is sent from a source to a any of the given destination nodes. This is used a lot in Content delivery Systems where we want to get content from any server.
If the message is sent to some subset of other nodes, it is called Multicasting. Used in situation when there are multiple receivers of same data. Like video conferencing, updating something on CDN servers which have replica of same data.
If the message is sent to all the nodes in a network it is called Broadcasting. This is typically used in Local networks, for examples DHCP and ARP use broadcasting.
What are layers in OSI model?
There are total 7 layers
1. Physical Layer
2. Data Link Layer
3. Network Layer
4. Transport Layer
5. Session Layer
6. Presentation Layer
7. Application Layer
What is Stop-and-Wait Protocol?
In Stop and wait protocol, a sender after sending a frame waits for acknowledgement of the frame and sends the next frame only when acknowledgement of the frame has received.
What is Piggybacking?
Piggybacking is used in bi-directional data transmission in the network layer (OSI model). The idea is to improve efficiency piggy back acknowledgement (of the received data) on the data frame (to be sent) instead of sending a separate frame.
Differences between Hub, Switch and Router?
Hub | Switch | Router |
Physical Layer Device | Data Link Layer Device | Network Layer Device |
Simply repeats signal to all ports | Doesn’t simply repeat, but filters content by MAC or LAN address | Routes data based on IP address |
Connects devices within a single LAN | Can connect multiple sub-LANs within a single LAN | Connect multiple LANS and WANS together. |
Collision domain of all hosts connected through Hub remains one. i.e., if signal sent by any two devices can collide. | Switch divides collision domain, but broadcast domain of connected devices remains same. | It divides both collision and broadcast domains, |
What happens when you type a URL in web browser?
A URL may contain request to HTML, image file or any other type.
- If content of the typed URL is in cache and fresh, then display the content.
- Else find IP address for the domain so that a TCP connection can be setup. Browser does a DNS lookup.
- Browser needs to know IP address for a url, so that it can setup a TCP connection. This is why browser needs DNS service. 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 a HTTP response.
- Browser receives the HTTP response and renders the content.
- 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 new device as they are not DHCP server.
What is ARP, how does it work?
ARP stands for Address Resolution Protocol. ARP is used to find LAN address from Network address. A node typically has destination IP to send a packet, the nodes needs link layer address to send a frame over 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.
Network Devices (Hub, Repeater, Bridge, Switch, Router and Gateways)
1. Repeater – A repeater operates at the physical layer. Its job is to regenerate the signal over the same network before the signal becomes too weak or corrupted so as to extend the length to which the signal can be transmitted over the same network. An important point to be noted about repeaters is that they do no amplify the signal. When the signal becomes weak, they copy the signal bit by bit and regenerate it at the original strength. It is a 2 port device.
2. Hub – A hub is basically a multiport repeater. A hub connects multiple wires coming from different branches, for example, the connector in star topology which connects different stations. Hubs cannot filter data, so data packets are sent to all connected devices. In other words, collision domain of all hosts connected through Hub remains one. Also, they do not have intelligence to find out best path for data packets which leads to inefficiencies and wastage.
3. Bridge – A bridge operates at data link layer. A bridge is a repeater, with add on functionality of filtering content by reading the MAC addresses of source and destination. It is also used for interconnecting two LANs working on the same protocol. It has a single input and single output port, thus making it a 2 port device.
4. Switch – A switch is a multi port bridge with a buffer and a design that can boost its efficiency(large number of ports imply less traffic) and performance. Switch is data link layer device. Switch can perform error checking before forwarding data, that makes it very efficient as it does not forward packets that have errors and forward good packets selectively to correct port only. In other words, switch divides collision domain of hosts, but broadcast domain remains same.
5. Routers – A router is a device like a switch that routes data packets based on their IP addresses. Router is mainly a Network Layer device. Routers normally connect LANs and WANs together and have a dynamically updating routing table based on which they make decisions on routing the data packets. Router divide broadcast domains of hosts connected through it.
6. Gateway – A gateway, as the name suggests, is a passage to connect two networks together that may work upon different networking models. They basically works as the messenger agents that take data from one system, interpret it, and transfer it to another system. Gateways are also called protocol converters and can operate at any network layer. Gateways are generally more complex than switch or router.