top of page

System Design: Computer Networking


Today I started reading about System design. I wanted to understand what System design is and why its so important. System design helps us define a solution that meets the business requirements. It is one of the earliest decisions we can make when building a system. Often it is essential to think from a high level as these decisions are very difficult to correct later.


So lets start by understanding the concepts of Computer Networking.


Computer Networking


Networking

IP


An IP address is a unique address that identifies a device on the internet or a local network. IP stands for "Internet Protocol". In essence, IP addresses are the identifier that allows information to be sent between devices on a network. They contain location information and make devices accessible for communication.

IP address is something similar to home address. How a home address is used to identify a particular home, similar way an IP address is used to identify a device over internet or within a local network.


Let us now try to understand what are the different version of IP address:


IPv4

The original Internet Protocol is IPv4 which uses a 32-bit numeric dot-decimal notation that only allows for around 4 billion IP addresses.

Example: 102.22.192.181

In IPv4 we have 32 bit

8 bit (.) 8 bit (.) 8 bit (.) 8 bit
Here Each section can have numbers ranging from 0 - 255
    
         128  64 32 16 8 4 2 1
Lowest    0    0  0  0 0 0 0 0   which is 0
Highest   1    1  1  1 1 1 1 1   which is 255


IPv6

IPv6 is a new protocol that was introduced in 1998. This new protocol uses 128-bit alphanumeric hexadecimal notation. This means that IPv6 can provide about ~340e+36 IP addresses. That's more than enough to meet the growing demand for years to come.

Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Let's discuss types of IP addresses:


Public

A public IP address is an address where one primary address is associated with your whole network. In this type of IP address, each of the connected devices has the same IP address.

Example: IP address provided to your router by the ISP.


Private

A private IP address is a unique IP number assigned to every device that connects to your internet network, which includes devices like computers, tablets, and smartphones, which are used in your household.

Example: IP addresses generated by your home router for your devices.


Static

A static IP address does not change and is one that was manually created, as opposed to having been assigned. These addresses are usually more expensive but are more reliable.


Dynamic

This is the type of IP address which is not constant. For example the IP address attached when we create a EC2 instance on AWS. As soon as the EC2 instance is stopped and restarted the IP address changes. They are cheaper to deploy and allow us to reuse IP addresses within a network as needed.


OSI Model


OSI Model

Application

The application layer is the sole layer that interacts directly with user data. Software applications such as web browsers and email clients depend on the application layer to start communication. It's important to note that client software applications are not part of the application layer; instead, the application layer is accountable for the protocols and data handling that the software utilizes to deliver relevant data to the user. Noteworthy application layer protocols are HTTP and SMTP.


Presentation

The presentation layer is also called the Translation layer. The data from the application layer is extracted here and manipulated as per the required format to transmit over the network. The functions of the presentation layer are translation, encryption/decryption, and compression.


Session

The layer that manages the initiation and termination of communication between two devices is known as the session layer. The period during which the communication is active is referred to as the session. This layer is responsible for maintaining the session open for the duration necessary to complete the data exchange and then efficiently closing it to prevent resource wastage. Additionally, the session layer coordinates data transfer by implementing checkpoints.


Transport

The transport layer (also known as layer 4) is responsible for end-to-end communication between the two devices. This includes taking data from the session layer and breaking it up into chunks called segments before sending it to the Network layer (layer 3). It is also responsible for reassembling the segments on the receiving device into data the session layer can consume.


Network

The network layer is responsible for facilitating data transfer between two different networks. The network layer breaks up segments from the transport layer into smaller units, called packets, on the sender's device, and reassembles these packets on the receiving device. The network layer also finds the best physical path for the data to reach its destination this is known as routing. If the two devices communicating are on the same network, then the network layer is unnecessary.


Data Link

The data link layer is very similar to the network layer, except the data link layer facilitates data transfer between two devices on the same network. The data link layer takes packets from the network layer and breaks them into smaller pieces called frames.


Physical

This layer includes the physical equipment involved in the data transfer, such as the cables and switches. This is also the layer where the data gets converted into a bit stream, which is a string of 1s and 0s. The physical layer of both devices must also agree on a signal convention so that the 1s can be distinguished from the 0s on both devices.



TCP


Transmission Control Protocol (TCP) is connection-oriented, meaning once a connection has been established, data can be transmitted in both directions. TCP has built-in systems to check for errors and to guarantee data will be delivered in the order it was sent, making it the perfect protocol for transferring information like still images, data files, and web pages.


TCP

But while TCP is instinctively reliable, its feedback mechanisms also result in a larger overhead, translating to greater use of the available bandwidth on the network.


UDP

User Datagram Protocol (UDP) is a simpler, connectionless internet protocol in which error-checking and recovery services are not required. With UDP, there is no overhead for opening a connection, maintaining a connection, or terminating a connection. Data is continuously sent to the recipient, whether or not they receive it.


UDP

It is largely preferred for real-time communications like broadcast or multicast network transmission. We should use UDP over TCP when we need the lowest latency and late data is worse than the loss of data.


If you want to learn more about system design, then follow for daily updates on Instagram (@seasonalcoder)

1 Comment

Rated 0 out of 5 stars.
No ratings yet

Add a rating
Guest
Aug 01
Rated 5 out of 5 stars.

Provides good information

Like

Top Stories

bottom of page