Computer Networks Basics - Beginner's Guide
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 -
- Message - It is the information/data that needs to be delivered.
- Sender - The source where the message originates from.
- Receiver - The recipient of the message.
- Medium - The tangible/non-tangible mass the message propagates through.
- 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 -
- Logical Link Control(LLC) - Identifies network protocol and error checking and synchronizes control
- 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 -
- Application, Presentation, and Session Layers have been squashed into a single layer collectively known as Application Layer.
- 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:
- 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.
- 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.
- FTP - File Transfer Protocol. It is used for sharing or transferring files among two hosts.
- 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.
- 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 -
- 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.
- 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 PROTOCOL | TRANSPORT PROTOCOL | PORT NUMBER |
---|---|---|
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.
CLASS | IST OCTET DECIMAL RANGE | NETWORK/HOST ID | DEFAULT SUBNET MASK |
---|---|---|---|
IPv4 & IPv6
NOS | IPV4 | IPV6 |
---|---|---|
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.