DateOct 18, 2022

Computer Networks Basics - Beginner's Guide

🚧
Readers who wish to gain some basic knowledge or are looking to brush up on their core concepts pertaining to Computer Networks, especially if you are going for a Job interview. The post will not cover topics in detail but will link to relevant sources for deeper understanding.

Introduction

A Network is a collection of interconnected entities. A Computer Network is a set of computers sharing resources on network nodes. The computers use a common communication protocol over digital interconnection to communicate with each other. Perhaps the best example of a Computer Network is the present-day Internet with billions of nodes, all sharing data with each other!

In this post, let's brush up on the basics of Computer Networks!

Before we begin, you should have a clear understanding of the major components of a Networking System -

  1. Message - It is the information/data that needs to be delivered.
  2. Sender - The source where the message originates from.
  3. Receiver - The recipient of the message.
  4. Medium - The tangible/non-tangible mass the message propagates through.
  5. Protocol - Set of rules that govern the communication to maintain coherence.

Network Topologies

Network Topologies are how the links and nodes of a network are arranged to communicate with each other. It can be both physical and virtual(Software-defined Networks are virtual topologies)!

Today the most commonly used topologies are -

BUS Topology

In this topology, every network device is connected to a single cable and it transmits data only in one direction.

RING Topology

In this topology, each computer is connected to another computer in the form of a ring with the last computer connected to the first one.

STAR Topology

In this type of topology, all the nodes are connected to a single network device through a cable.

MESH Topology

Every node is connected to another one with a point-to-point topology and every node is connected.

TREE Topology

It has a root node and all the sub-nodes are connected to the root node in the form of the tree, thereby making a hierarchy. Normally, it has three levels of hierarchy and it can be expanded according to the need of the network.

Usually, star, bus, or ring topologies are used for networking and the modes used are half-duplex, full-duplex, or simplex.

Network Models

Network Engineering is a highly complex task that involves both Software as well as hardware components. To ease the designing, testing, and maintaining process, the whole concept is divided into multiple layers. Each layer has a particular function and is independent of other layers. They depend on each other only to take input and send output.

The Industry has adopted below two models for Network Engineering. All the hardware and software standards are derived using the below models.

OSI Model

OSI or Open System Interconnect is an open Standard for all communication Systems. It was established by International Standard Organization(ISO). It consists of the below layers -

Application Layer

  • Used by end-user Software (web browsers, email, etc.)
  • Provides protocols to send and receive information
  • Ex: HTTP, FTP, POP, DNS

Presentation Layer

  • Prepares data for Application Layer
  • Defines how two devices should encode encrypt and compress data
  • prepares data for transmission over session layer

Session Layer

  • creates communication channels called Sessions
  • Responsible for opening and maintaining sessions.
  • Can also set checkpoints to resume data transfer from the last checkpoint

Transport Layer

  • Breaks data into segments and then reassembling them
  • It carries outflow control, sending data at a connection speed of receiving device
  • It also serves as error control and requests again if the data is corrupted

Network Layer

  • This layer has the accountability to accomplish the routing of data packets from the source to destination host between the inter and intra networks operating on the same or different protocols.
  • Routing packets - discovering the best path
  • uses network addresses(IPs) to route to the destination node

IP Addressing: The IP address is a logical network address and is a 32-bit number that is globally unique for each network host. It principally consists of two parts i.e. network address & host address.

Data Link Layer

  • Establishes and terminates the connection between two physical nodes
  • Breaks packets into frames
  • Performs Error detection

It has two parts -

  1. Logical Link Control(LLC) - Identifies network protocol and error checking and synchronizes control
  2. Media Access control(MAC) - Defines permissions to transmit and receive. It is a unique device address and each device or component in a network has a MAC address based on which we can uniquely identify a device of the network. It is a 12 digit unique address.

Physical Layer

  • Physical entities such as routers, cables, wireless nodes
  • Transfers raw data - 0s and 1s
  • Takes care of bit rate.

TCP/IP Model

TCP/IP Model is a practical and simplified version of the OSI Model wherein a few of the layers have been squashed into a single layer -

  1. Application, Presentation, and Session Layers have been squashed into a single layer collectively known as Application Layer.
  2. Physical and Data link Layer have been combined into what is known as Network Access Layer.

Summarising the function of each layer -

Application Layer

It performs all the functions of the Application, Presentation, and Session layers in the OSI model.

The most common application layer protocols are defined below:

  1. TELNET - It stands for Terminal Emulation Protocol. It is usually used for accessing remote end applications. The telnet server which acts as the host initiates a telnet server application to establish a connection with the remote end host known as the telnet client.
  2. HTTP - It stands for hypertext transfer protocol. It is the base of the World Wide Web (WWW). This protocol is used to exchange the hypertext among different systems. It is a type of request-response protocol. HTTP resources are located on the internet using URLs.
  3. FTP - File Transfer Protocol. It is used for sharing or transferring files among two hosts.
  4. DNS - Domain name system is an alias for IP Addresses. Image having to type 142.251.16.99 for google.com. DNS resolving is usually provided by your ISP.
  5. DHCP - Every device in a network requires an IP address. This could be configured manually or is provided by DHCP - Dynamic Host configuration protocol.

Transport Layer

This layer is responsible for the overall transfer of data. It helps in establishing end-to-end logical connectivity between the server and client host in a network.

The transport layer uses below two widely used protocols -

  1. TCP - Or Transmission control protocol is a connection-based and reliable protocol. This protocol is the most widely used for exchanging data between servers and clients. TCP used a three-way-handshake to establish a connection between the parties by generating SYN and ACK flags.
  2. UDP - Or User datagram protocol is a fairly unreliable connectionless protocol. UDP is used in scenarios where latency matters more than reliability. Hence it is most widely used in gaming, video streaming, etc. In these scenarios, error checking and correction take place at the application layer. Also since it backs the multicast, it is appropriate for broadcast services such as Bluetooth and routing information protocol.

Connection Ports

Ports are used to forward traffic received from the Network to the respective applications running on a host machine. They are what allow a machine to send and receive traffic from several sources at the same time.

APPLICATION PROTOCOLTRANSPORT PROTOCOLPORT NUMBER
HTTPTCP80
HTTPSTCP443
FTP(control)TCP21
FTP(data)TCP20
SSHTCP22
TelnetTCP23
DNSTCP, UDP53
SMTPTCP25
TFTPUDP69

IP Address

IP Addressing is used to recognize the host of a network and uniquely identify a particular device in a network. It works on the Layer-3(Network Layer) of the OSI reference model and the network components like routers and switches are the host devices that are most popularly used.

An IP Address(IPv4) is a 32-bit logical address that distinctively classifies a host of the network.

CLASSIST OCTET DECIMAL RANGENETWORK/HOST IDDEFAULT SUBNET MASK
A1 to 126N.H.H.H255.0.0.0
B128 to 191N.N.H.H255.255.0.0
C192 to 223N.N.N.H255.255.255.0
D224 to 239Reserved for Multicasting
E240 to 254Experimental

IPv4 & IPv6

NOSIPV4IPV6
1)It stands for Internet Protocol version 4.It stands for Internet Protocol version 6.
2)It is having 32-bit addressing space which implies that 2^32 = 4.3 billion devices can be connected with it.It is having a 128-bit addressing scheme which implies that it supports 2^128 devices which is itself a very huge number and can serve users in many more years to come.
3)It is a numeric addressing method. For example, the IP address to allocated user will be like 192.10.128.240It is alphanumeric based addressing scheme and for example, the IP address of a host will be like 1280:0db2:26c4:0000:0000:7a2e:0450:8550
4)IPV4 supports manual and the DHCP configuration method and it doesn’t support the feature of auto configuration.The IPV6 has the feature of auto-configuration and the IPV6 hosts can itself configure themselves to the IPV6 network using ICMPv6 messages.
5)It supports the broadcast addressing scheme as the data packet is sent to all the host devices available in the network.It supports multicast features as the single packet data can be sent to multiple destination hosts at a time.
6)The IPV4 doesn’t support any security protocols for the secure transmission of data between hosts.All the sessions of IPV6 are first authenticated by using the various security protocols like IPSec etc. then the communication between the hosts on a secure network will initiate.
7)The IPV4 header length is variable and thus routing process is bit complex as compared to IPV6.The IPV6 header has a fixed header length of 40 bytes thus offers a simplified routing process.
8)The checksum error is detected and computed in IPV4.The checksum error is not computed in IPV6.
9)It doesn’t support any IP host mobility function.It supports the IP host mobility feature which enables the moving node to temporarily change its location in a network with maintaining the ongoing connections at the same time.
10)The quality of service QoS feature is not very efficient.

Subnetting(Masks) & Network Classes

Subnetting enables us to create sub-networks within larger Networks. It helps -

  • Preventing unnecessary usage of IPv4 addresses - we don't have a lot of them!
  • In improving network performance and speed by restricting traffic to required 'subnet' and not congestion bandwidth of the whole network.
  • In improving network security by implementing Access control lists (ACLs) and disallowing external devices to connect to devices within a subnet.
  • In easier administration under logical splitting of the network.

URL and its parts

Scheme

The scheme tells web servers which protocol to use when it accesses a page on a website. Today HTTPS(Hypertext Transfer Protocol Secure) is the most widely used scheme. This security protocol protects your website visitors and implementing it will help your site rank better on Google. That's why implementing SSL is a must-do on any technical SEO guide.

Other schemes also include - mailto://ftp://.

Sub-Domain

Sub Domains are like leaves in a Domain Tree. You can have as many subdomains for a single domain. For example, I use ghost.limosyn.com a subdomain for hosting my CMS. I could have api.limosyn.com for hosting any backend Applications.

Second Level Domain

The second-level domain(SLD) is the name of the website. It helps people understand which website, they are visiting. For example in this blog, *.limosyn.* is the Second Domain Name.

Top-Level Domain

The Top-Level Domain specifies the type of entity an organization registers as on the internet. Websites usually use .com.edu, `.

Subdirectory

It is the subpath after your top-level domain. For example, you are in /posts/computer-networks-beginners-guide subpath on this website.

A subpath may include parameters that are sent to the server as GET request.

Conclusion

In this post, I have tried to brush up on some of the very basic concepts in Computer Networks. Check out the below website for in-depth knowledge in Networking.