Introduction to Computer Networks | IP Addresses, Mac Addresses and Networking Devices

Addressing schemes, Repeaters, Hubs, Bridges, Switchers and Routers

Ashwin Prasad
7 min readJan 27, 2024
Computer Networks - Making the Internet Uncool Again : Addressing Schemes and Network Devices
Making the Internet Uncool Again — Part 1

A computer network is just an interconnection of nodes that are capable of sharing resources with one another. The reason why we want to share resources over multiple systems is self explanatory in today’s world.

  • The reason you are able to send messages to others
  • News, Satellites, Social Media, E-commerce, etc.

All these are possible only because of computer networks and the communication capabilities that they provide.
Network is not really a magical term. if you connect two computers using a wire in such a way that they are able to communicate with each other, that constitutes a network.

Hosts and IP addresses

Before diving further into networks and understanding how various networking devices work, It is important to know what are hosts and IP addresses.

Hosts: They are just devices that sends or receives data or traffic. Eg: mobile phones, laptops, desktops, servers, etc.
Hosts are of 2 types; i.e., Clients and Servers

fig 1.1: client server request response

Clients are hosts that initiate requests.
Servers are hosts that respond to requests. They are simply computers that have software installed in them that are capable of responding to specific requests.

A fairly sized network consists of a lot of hosts that are connected, and we need a way to identify these hosts in order for the network to be operative. For a host to be able to transfer data to another specific host in this huge plethora of devices, the source needs to be able to identify the destination host distinctly. This is where IP addresses come in.

IP Addresses: This is nothing but an addressing scheme that is used to identify a host uniquely in a network. It is essentially like a phone number.

fig 1.2: source destination IP address illustration

IP addresses are a 32 bit addressing scheme ( IPv6 is 128 bits ). i.e. each host has an IP address that is made of different combinations of 32 1s and 0s. For usual representation of IP addresses, these 32 bits is split into 4 chunks and each chunk is converted from octet to decimal.

Hierarchy of IP Addresses

fig 2.1: Example of hierarchical structure of IP addresses

Another important property to know about IP addresses is that they are hierarchical in nature. Assume there exists a company called TML Corp. and they own all the IP addresses starting with 10.
This organization has 3 branches in 3 different countries and have split the network into 3 such that any host that has an IP address starting with 10 and followed by 20 belongs to the Indian branch of TML Corp.
They have further split that network so as to assign different departments of the branch different networks (as shown in the fig 2.1)

Having a hierarchical structure of networks is beneficial in so many ways and makes inter network data transfer easier. This breaking up of networks into hierarchies is done through a process called subnetting which is a separate topic on it’s own. Deeper views into subnetting and it’s benefits will be shared in the future.

Mac addresses

While the IP Address for a device is a logical addresses and is susceptible to frequent changes, a mac address of a device is set during it’s manufacturing. Every Network interface card has it’s own mac address.

A device only gets an IP address when it is connected to the internet and can be used to find it’s location on the internet. But the mac address is a distinct address for every host.

The 48 bits long mac address is just another addressing scheme that is used for communication within a network whereas IP address is used for communication between networks.

Why do we need mac addresses when we already have IP address ? This question will be answered when we deep dive into how switches and routers work.

IP addresses are further classified into public and private IP Addresses. The private IP address of 2 different hosts belonging to 2 different networks can be the same whereas the mac address of the hosts will always be different and unique. Common home routers might have a public as well as a private IP address to communicate with outside networks and the home network respectively but the hosts connected to the home network will only be assigned private IP addresses.

Private IP Addresses usually start with 172…, 192… or 10…
More about private vs public IP addresses in an upcoming blog.

Different Networking Devices and Types

Having seen the hierarchical structures of the IP addresses, It is time to discuss the different types of networking devices and their significance.

  • Repeater
  • Hub
  • Bridge
  • Switch
  • Router
  1. Repeater
A Repeater in action
Fig 4.1 : Working of a Repeater

The repeater only has one job: Amplify and retransmit the incoming signal. Signals might have to cover a long distance and the more the distance between the signal and it’s source, the weaker it becomes. A repeater can be used in such instances to re-transmit the signal with greater amplification and thus allows communication over longer distances.

2. Hub

Let’s imagine we have a small network of 5 hosts. Each host needs to communicate with every other host. We can make this possible by connecting all the hosts with each other.

A network with fully connected topology
Fig 4.2 : Fully connected topology

The limitation of this approach is that it doesn’t scale well. If we have to install one more host in this network, it has to be connected to all the other hosts.
The number of connections required here is also high.
Number of connections = n * (n-1) , where n is the number of hosts.

This is where a hub comes into play.

Fig 4.3 : Hub — Signal transmitting from source

One can think of a hub as a repeater that is capable of re-transmitting the source signal across multiple ports.

Fig 4.4: Hub — Signal re-transmitted to destinations

Now that we have a hub, the number of connections is equal to the number of hosts, and installing a new connection is also very cheap since it only needs to be connected to the hub.

3. Bridge

A bridge is a device that can be used to extend multiple sub-networks to form an extended network. A bridge typically sits between 2 hubs.

Working of a Bridge
Fig 4.5 : Bridge

A bridge contains only 2 ports. A bridge doesn’t simply amplify the signal in all directions. The bridge knows (learns) which host lies on which side (interface).

Unlike a hub, a bridge does not broadcast to all the ports everytime it recieves a signal. It only carry forwards a signal or a packet from one network to another only when the destination is on the other network.

4. Switch

A switch is a combination of a bridge as well as a hub. They have multiple ports and knows (learns) which hosts are connected to which ports.

Fig 4.6 : A Switch in action

Here, messages will be transmitted only to the necessary hosts (There are exceptions to this in some cases). A switch is used for communication within a network.

5. Routers

Routers are similar to switches but they differ in the notion that they are used for communication between different networks. Your home router has a built-in switch to which all the local devices are connected. All packets are redirected to the internal switch and are forwarded to the router.

Fig 4.7 : Router connecting multiple networks.

Routers use a routing table(IP Addresses) for transfer of packets whereas switches use mac tables(mac addresses). The difference between these 2 components become more clear when the different protocols used in them are discussed.
The internet is just a collection of routers where each router knows which router to pass the packet to until the destination network is reached.

References

Conclusion

The internet is just a collection of networks with a bunch of routers that help transfer packets from one host to another. Once the packet reaches the appropriate destination network, the Intra-Network devices take over to make sure that the packet is delivered to the appropriate host within the network. IP addresses, Mac addresses, Routing tables and other protocols are just tools that help do accomplish the process.

In the next blog, I’ll emphasise on how Intra-Network communication takes place.

--

--

Ashwin Prasad

I write about things that intrigue me on any field of Computer Science, with more weightage to Machine Learning and Systems Programming