How Data flows through the Internet

source: Internet

Terminologies

Data: Data is nothing but a message which needs to be transferred from a Source to a Target. Data is represented in the form of bits (0s and 1s).

Devices

Following are the important devices that facilitate moving data from source to destination.

NIC

Repeaters

Data transmission through various channels loses its strength as it travels, making it difficult for long-distance communication.

Hub

A Hub is a multi-port Repeater that can increase the strength of signals and transmit it across multiple destination ports. For all practical purposes, Hubs are largely obsolete and replaced with Switches.

Bridge

A Bridge is installed between two Hubs which provides exactly two ports. A Bridge can learn which Hosts are on either side of the Bridge and can forward traffic accordingly. For all practical purposes, Bridges are largely obsolete similar to Hub, and replaced with Switches.

Switch

Switch
  1. MAC Address Table: This table maintains a mapping of Port to MAC Address which is used to look up the destination port to which the data should be forwarded for a given MAC Address.
  2. ARP Cache Table: This table maintains a mapping of IP Address to MAC Address which is used to look up the destination MAC address to which the data should be forwarded for a given IP Address.
  1. Learn: Update MAC Address Table with a mapping of Port to MAC Address when a packet arrives in the Switch for which the mapping is not found.
  2. Flood: Send the packet over all the ports when the Switch receives the packet with no destination MAC Address. When the destination Host acknowledges the packet back to Switch, it updates its ARP Cache Table with the mapping of the destination MAC Address to IP Address.
  3. Forward: Forward the packet to the appropriate destination Port if the corresponding mapping of Port to MAC Address exists in MAC Address Table.

Router

Router
  1. Routing Table: This table maintains a mapping of Routes to a particular Network. It primarily includes the Interface ID, Route Matching Policy, and the Next Hop if the destination IP matches the Route Matching Policy.
  2. ARP Cache Table: This table maintains a mapping of IP Address to MAC Address. Routers use this table to identify the destination MAC address to which the Data should be forwarded for a given IP Address.

Modem

Channels

Data has to be propagated through various Channels before reaching the destination.

DSL Cable

Digital Subscriber Line is a type of transmission line that transmits data over a telephone network through a telephone cable. DSL is mainly used for small to medium distances and can transmit data up to 6.1Mbps

Coaxial Cable

Coaxial cable internal structure
  1. An innermost conductor made of copper wire is used to carry electromagnetic signals.
  2. An Insulator surrounding copper wire that provides Insulation.
  3. A couple of strands of Metal Mesh surround the Insulator which prevents interference of electromagnetic signals and prevents cross talks.
  4. An outermost plastic sheath that provides overall protection.

Fiber Optic Cable

Optic Fiber internal structure
  1. An innermost core layer made of silica is responsible for transmitting the light and consists of thousands of fiber strands as thin as human hair.
  2. A Cladding layer surrounds the Core providing a protective layer with a lower Refractive Index enabling Total Internal Reflection.
  3. A plastic Coating layer surrounds Cladding acting as a shock absorber and providing protection against excessive cable bends.
  4. Strength Members provide additional protection and reduce cross-talks.
  5. An outermost Plastic jacket protects against environmental hazards.

Total Internal Reflection

Total Internal Reflection
Refractive Index = Speed of Light in Vaccum / Speed of Light of Medium 

OSI Model

OSI Model is a framework that defines the rules of communication of a Host.

Application Layer(L7 Layer)

The Application Layer receives User input and converts them to binary before sending it to Transport Layer.

Transport Layer (L4 Layer)

The Transport Layer receives data from the L7 layer and breaks them into smaller chunks adding source and destination Port to it to create Segments.

Network Layer (L3 Layer)

The Network Layer receives Segments from L4 Layer and adds source and Destination IP Addresses to it to form Packets.

Data Link Layer (L2 Layer)

The Data Link Layer receives Packets from the L3 Layer and adds Source and Destination MAC addresses to it to form Frames.

Physical Layer(L1 Layer)

The Physical Layer(L1 Layer) is the final layer and is responsible for receiving Frames from the L2 layer in the form of bits and converting them into Analog/Digital signals that are propagated through one of the Channels.

Domain Name System

The Domain Name System (DNS) is a naming system for resolving Domain Names like www.google.com into corresponding IP Addresses.

  1. Root NameServer: This server acts as a reference for all top-level domains like .com, .net, etc... The Root NameServer redirects the Recursor to TLD NameServer.
  2. Top-Level Domain NameServer(TLD NameServer): This server acts as a reference for a particular top-level domain and it redirects the Recursor to Authoritative NameServer to resolve the final IP Address.
  3. Authoritative NameServer: This server is responsible for knowing everything about the domain and resolves the IP Address to Recursor.

Address Resolution Protocol (ARP)

Address Resolution Protocol is used to resolve the MAC Address of the next hop in the same Network.

  1. Host 1 goes through the OSI Layer to construct Packets in the L3 Layer.
  2. Host 1 initiates the ARP to identify the MAC address of Host 2. ARP request includes the source and destination IP and source MAC Address.
  3. When the request reaches the Switch, Switch checks its ARP Cache. Since the mapping is not found, it Floods the ARP Request on all the Hosts in the Network.
  4. Host 2 acknowledges the ARP Request and sends an ARP Response with its MAC Address to the Switch while other Hosts ignore the request.
  5. Switch updates its ARP Cache and forwards it to Host 1
  6. Host 1 learns the MAC Address of Host 2 and updates its ARP Cache.

Border Gateway Protocol

Border Gateway Protocols among Autonomous Systems
  1. Open: Establishes a TCP connection with the Peers.
  2. Update: Exchanges routing information with Peers which includes new Routes to be advertised, existing Routes to be withdrawn, Vector Path of Autonomous Systems which are not directly connected, their weights so that the receiving Autonomous Systems can create a preferred Route selection mechanism.
  3. Notification: Message sent by a BGP Peer when there is an error detected with the session.
  4. Keep Alive: Periodic Ping to Peers to check for connectivity.

Connecting the dots

Here is the oversimplified view of the data flow on the Internet.

Host Connectivity

The user purchases a computer with NIC built-in which provides a MAC Address (aecd). Let’s call this computer Host 1.

DNS resolution

Now that the Internet connectivity is established for the Host 1, the user opens the browser and hits the domain http://www.google.com

Input Construction

Once the destination IP Address is known, the next step is the construction of an input request. The user input goes through the OSI Layer before being transmitted over the wire.

Data Transmission

Each of the individual Frames is transmitted to the Router independently, the Default Gateway for the Network.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store