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.
Why does DNS use UDP and not TCP?
DNS is an application layer protocol. All application layer protocols use one of the two transport layer protocols, UDP and TCP. TCP is reliable and UDP is not reliable. DNS is supposed to be reliable, but it uses UDP, why?
There are following interesting facts about TCP and UDP on transport layer that justify the above.
1) UDP is much faster. TCP is slow as it requires 3 way handshake. The load on DNS servers is also an important factor. DNS servers (since they use UDP) don’t have keep connections.
2) DNS requests are generally very small and fit well within UDP segments.
2) UDP is not reliable, but reliability can added on application layer. An application can use UDP and can be reliable by using timeout and resend at application layer.
1) UDP is much faster. TCP is slow as it requires 3 way handshake. The load on DNS servers is also an important factor. DNS servers (since they use UDP) don’t have keep connections.
2) DNS requests are generally very small and fit well within UDP segments.
2) UDP is not reliable, but reliability can added on application layer. An application can use UDP and can be reliable by using timeout and resend at application layer.
Computer Network | Circuit Switching VS Packet Switching
CIRCUIT SWITCHING | PACKET SWITCHING | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
In circuit switching there are 3 phases i) Connection Establishment. ii) Data Transfer. iii) Connection Released. | In Packet switching directly data transfer takes place . | ||||||||||||||||||
In circuit switching, each data unit know the entire path address which is provided by the source | In Packet switching, each data unit just know the final destination address intermediate path is decided by the routers. | ||||||||||||||||||
In Circuit switching, data is processed at source system only | In Packet switching, data is processed at all intermediate node including source system. | ||||||||||||||||||
Delay between data units in circuit switching is uniform. | Delay between data units in packet switching is not uniform. | ||||||||||||||||||
Resource reservation is the feature of circuit switching because path is fixed for data transmission. | There is no resource reservation because bandwidth is shared among users. | ||||||||||||||||||
Circuit switching is more reliable. | Packet switching is less reliable. | ||||||||||||||||||
Wastage of resources are more in Circuit Switching | Less wastage of resources as compared to Circuit SwitchingCommonly asked Computer Networks Interview Questions | Set 1
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?
See network devices for more details.
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?
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 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.
Like DHCP, ARP is a discovery protocol, but unlike DHCP there is not server here.
See this video for detailed explanation.
Practice Quizzes for Networking
Computer Networks | Longest Prefix Matching in Routers
What is Forwarding?
Forwarding is moving incoming packets to appropriate interface. Routers use forwarding table to decide which incoming packet should be forwarded to which next hop.
What is IP prefix?
IP prefix is a prefix of IP address. All computers on one network have same IP prefix. For example, in 192.24.0.0/18, 18 is length of prefix and prefix is first 18 bits of the address.
How does forwarding work?
Routers basically look at destination address’s IP prefix, searches the forwarding table for a match and forwards the packet to corresponding next hop in forwarding table.
What happens if the prefixes overlap?
Since prefixes might overlap (this is possible as classless addressing is used everywhere), an incoming IP’s prefix may match multiple IP entries in table. For example, consider the below forwarding table In above table, addresses from 192.24.12.0 to 192.24.15.255 overlap, i.e., match with both entries of the table. To handle above situation, routers use Longest Prefix Matching rule. The rule is to find the entry in table which has the longest prefix matching with incoming packet’s destination IP, and forward the packet to corresponding next hope. In the above example, all packets in overlapping range (192.24.12.0 to 192.24.15.255) are forwarded to next hop B as B has longer prefix (22 bits). Example 1: Routers forward a packet using forwarding table entries. The network address of incoming packet may match multiple entries. How routers resolve this? (A) Forward it the the router whose entry matches with the longest prefix of incoming packet (B) Forward the packet to all routers whose network addresses match. (C) Discard the packet. (D) Forward it the the router whose entry matches with the longest suffix of incoming packet Answer: (A) The network addresses of different entries may overlap in forwarding table. Routers forward the incoming packet to the router which hash the longest prefix matching with the incoming packet. Example 2: Classless Inter-domain Routing (CIDR) receives a packet with address 131.23.151.76. The router’s routing table has the following entries: (GATE CS 2015) Prefix Output Interface Identifier 131.16.0.0/12 3 131.28.0.0/14 5 131.19.0.0/16 2 131.22.0.0/15 1
The identifier of the output interface on which this packet will be forwarded is ______.
Answer: “1”. We need to first find out matching table entries for incoming packet with address “131.23.151.76”. The address matches with two entries “131.16.0.0/12” and “131.22.0.0/15” (We found this by matching first 12 and 15 bits respectively).
So should the packet go to interface 3 or 1? We use Longest Prefix Matching to decide among two. The most specific of the matching table entries is used as the interface. Since “131.22.0.0/15” is most specific, the packet goes to interface 1. Exercise Consider the following routing table of a router. Consider the following three IP addresses. How are the packets with above three destination IP addresses are forwarded?
(A) 1->D, 2->B, 3->B
(B) 1->D, 2->B, 3->D (C) 1->B, 2->D, 3->D (D) 1->D, 2->D, 3->D
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
STUDENT: MOHAMMAD QADDAFI QURESHI BACH NO:397 PRIYA MEDUM |
No comments:
Post a Comment