Thursday, 4 January 2018

NETWORKING DEVICES


Network Devices (Hub, Repeater, Bridge, Switch, Router and Gateways)


symbols

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.
img1

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.

  • Network Devices (Hub, Repeater, Bridge, Switch, Router and Gateways)
  • Simple Mail Transfer Protocol (SMTP)
  • DNS (Domain Name Server) | NetWorking.
  • LZW (Lempel–Ziv–Welch) Compression technique
  • What’s difference between http:// and https:// ?
  • Computer Network | Dynamic Host Configuration Protocol (DHCP)
  • Computer Network | Hamming Code
  • Network Neutrality | All you need to know
  • Computer Network | Fixed and Flooding Routing algorithms
  • Computer Network | Types of area networks – LAN, MAN and WAN
  • Computer Network | Circuit Switching VS Packet Switching

    CIRCUIT SWITCHINGPACKET 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 sourceIn 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 onlyIn 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 SwitchingLess wastage of resources as compared to Circuit Switching

    Commonly 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?
    HubSwitchRouter
    Physical Layer DeviceData Link Layer DeviceNetwork Layer Device
    Simply repeats signal to all portsDoesn’t simply repeat, but filters content by MAC or LAN addressRoutes data based on IP address
    Connects devices within a single LANCan connect multiple sub-LANs within a single LANConnect 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,
    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.
    1. If content of the typed URL is in cache and fresh, then display the content.
    2. Else find IP address for the domain so that a TCP connection can be setup. Browser does a DNS lookup.
    3. 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.
    4. Browser sets up a TCP connection using three way handshake.
    5. Browser sends a HTTP request.
    6. Server has a web server like Apache, IIS running that handles incoming HTTP request and sends a HTTP response.
    7. Browser receives the HTTP response and renders the content.
    What is DHCP, how does it work?
      1. The idea of DHCP (Dynamic Host Configuration Protocol) is to enable devices to get IP address without any manual configuration.
      2. The device sends a broadcast message saying “I am new here”
      3. 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.
    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.
      1. The node sends a broadcast message to all nodes saying what is the MAC address of this IP address.
      2. Node with the provided IP address replies with the MAC address.
    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
    GATE CN1
    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).
    longestprefix


    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.
    GATE CN1
    Consider the following three IP addresses.
    GATE CN
    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