Introduction to Computer Networks for Beginners

Introduction to Computer Networks for Beginners

·

9 min read

WHAT IS A NETWORK?

Computers connected with each other are called a Network.

WHAT IS INTERNET?

The collection of interconnected Computers is called as Internet.

HOW IT ALL STARTED?

In an alternate history, the U.S. and the Soviet Union were engaged in a major war, with both sides competing intensely in technology and space. The Soviet Union gained a significant advantage by launching a powerful rocket, Sputnik Omega, which showcased their advanced technology and disrupted American plans.

In response, the U.S. formed ARPA- Advanced Research Projects Agency, a new agency dedicated to rapidly developing cutting-edge technologies. One of ARPA's key achievements was creating ARPANET, a network that would eventually become the Internet. Despite the initial advantage of the Soviets, this technological breakthrough helped the U.S. regain its footing.

The war eventually ended in a stalemate, leading both nations to focus on peace and collaboration. The intense competition and innovation from this period laid the foundation for many modern technological advancements.

There were 4 Places where the computers were located in USA

-MIT

-UCLA

-UNIVERSITY OF UTAH

-STANFORD

They used TCP - Transmission control protocol for transferring messages or whatever required for them

Everything was functioning smoothly with ARPANET, but a problem soon arose. As a research project, ARPANET was primarily designed for sharing information within the scientific community. However, researchers began using it to exchange their papers and data across different institutions and locations.

For instance, if Stanford sent information about computers to MIT, including a link to detailed research, the link itself often couldn't be accessed or properly interpreted by the receiving end. This limitation became apparent as the network grew and the need for a more user-friendly system to manage and retrieve information became clear.

To address this issue, the World Wide Web (WWW) was developed. The WWW provided a more intuitive way to link and access documents across the network, making it easier for researchers to share and find information. With its creation, the WWW significantly improved the functionality of ARPANET, transforming it into a more effective tool for global information exchange.

TIM BERNERS-LEE developed WWW

Click to Know The first www is a collection of pages or documents identified by URL- Uniform Resource Locator and interlinked by hyperlinks and accessed over the internet.

But how do we search we require search engines so this starts the development of search engines. YAHOO was the first to develop search engines

What are Protocols?

Protocols are like a set of rules that one needs to follow

Who sets these rules?

THE INTERNET SOCIETY is the one that sets these rules you can check it out -> internetsociety.org

Check out how we are connected with the whole world using cables under the sea -> submarinecablemap.com

WHAT IS A SERVER?

A server is a computer system that provides resources, programs or data to other computers known as clients over the network.

Some of List of Protocols

-TCP -> Transmission Control Protocol

-UDP -> User Datagram Protocol

-HTTP -> Hyper text transfer protocol

-HTTPS -> Hyper text transfer protocol secure

IP-ADDRESS -> Internet Protocol Address

$curl ifconfig.me -s -> to check IP-Address of your computer

  • IP-Address -> Its basically an address of your computer connected to the internet.

  • A port is a 16-bit numbers. So the total number of port numbers we can have is 2^16

  • A port or port number is a number assigned to uniquely identify a connection endpoint and to direct data to a specific service.

There are certain port numbers that are fixed they are :

  • HTTP - port 80

  • SQL - port 1433

  • MongoDB - port 27017

  • Reserved Ports -[0-1023]

  • Registered for Applications -[1024-49152]

  • Remaining - Public use

1Mbps -> mega bits per second

1Gbps -> Giga bits per second

  • when we are sending data to someone its called UPLOAD

  • when we are accessing data from someone its called DOWNLOAD

WHAT ARE THE TYPES OF NETWORK

  • LAN- (LOCAL AREA NETWORK)

    • It's a network that covers a small area/office

    • It is used to connect to computers in the same building or campus

  • MAN -(METROPOLITAN AREA NETWORK)

    • It's a network used to connect across Cities
  • WAN -(WIDE AREA NETWORK)

    • It's a network used to connect across countries

      • SONET - (SYNCHRONOUS OPTICAL NETWORK)

      • FRAME RELAY -(Connecting LAN to the internet)

HOW ARE COMPUTERS CONNECTED?

TOPOLOGIES

SOME OF THE TOPOLOGIES ARE:

  • BUS

  • RING

  • STAR

  • MESH

  • TREE

BUS TOPOLOGY :

  • All computers are connected in a single line.

  • If one computer fails, the entire network connection is lost.

  • Only one computer can send data at a time.

    RING TOPOLOGY:

  • Computers are connected in a circular loop.

  • If one computer fails, the whole network can be disrupted.

  • Data can take longer routes because it must pass through several computers to reach its destination.

    STAR TOPOLOGY:

  • All computers are connected to a central hub or switch.

  • If the central hub fails, the entire network is lost.

  • It is easy to add new computers and manage the network.

    MESH TOPOLOGY:

  • Every computer is connected to every other computer.

  • It is expensive to set up because of the many connections required.

  • Adding a new computer involves connecting it to every other computer.

  • There can be stability issues if not all connections are reliable.

    TREE TOPOLOGY

  • Combines elements of Bus and Star topologies.

  • It has fault tolerance, meaning the network can continue to operate even if some parts fail.

  • It’s organized hierarchically, which helps in managing and expanding the network efficiently.

STRUCTURE OF NETWORK

THE MOST IMPORTANT CONCEPT ASKED IN INTERVIEWS OSI MODEL

OSI MODEL - Open System Interconnection

There are 7 layers

  • Application layer

  • Presentation layer

  • Session layer

  • Transport layer

  • Network layer

  • Data Link layer

  • Physical layer

The easier way to remember is:

  • ALL - APPLICATION LAYER

  • PEOPLE - PRESENTATION LAYER

  • SHOULD - SESSION LAYER

  • TRY - TRANSPORT LAYER

  • NEW - NETWORK LAYER

  • DOMINOS - DATALINK

  • PIZZA - PHYSICAL LAYER

Application Layer - It provides services to the user

Presentation Layer - Takes care of the syntax and semantics of the information exchange between two communication systems.

Session Layer - It establishes, maintain , synchronize and terminate interaction between the sender and reciever.

Transport Layer - It responsible for process to process delivery

Network Layer - Responsible for delivery of individual packet from source to destination.

Data-Link Layer - Responsible for moving from one hop to next hop.

Physical Layer - Responsible for moving individual bits from one device to another.

The transport layer will break down the data into small segments and each segment will have its own ip-address and a sequencce number - sequence number is necessary in order to keep a track of the order of data.

The network layer will asign ip-address of sender and the reciever to every segments and it forms an ip packet . so that every data packet will reach the correct destination

IP-ADDRESS VS MAC ADDRESS

IP-ADDRESS -> it helps us to identify the device globally

MAC ADDRESS -> it helps us to identify the device locally

ANOTHER MODEL IS TCP/IP MODEL

  • It is known as Transmission Control Protocol / Internet Protocol also known as Internet Protocol Suite.

  • It consist of 5 layers

  • The presentation layer and session layer is combined into one

  • Layers are :

    • APPLICATION LAYER

    • TRANSPORT LAYER

    • NETWORK LAYER

    • DATA-LINK LAYER

    • PHYSICAL LAYER

APPLICATION LAYER

  • It provides services to the user example: Applications such as watsup, facebook etc:

There are two types of Architecture:

  • Client-Server Architecture

  • Peer-to-Peer Architecture

Client-Server Architecture:

Peer-to-Peer Architecture:

SOME OF THE IMP CONCEPTS:

  • Repeaters

  • Bridges

  • Hub

  • Gateway

  • Routers

  • Brouters

Some of Protocols:

  • HTTP -> hyper text transfer protocol

  • DHCP -> dynamic host control protocol

  • FTP -> File transfer Protocol

  • SMTP -> Simple mail Transfer Protocol

  • POP3 -> post-office-protocol

  • SSH -> Secure shell

  • VNC -> Virtual network control

  • telnet -> it uses port 23

  • UDP -> user Data gram protocol

Process vs thread

Process-> It's an instance of a program that is being execited.

Thread-> It's a segment of proccess.

Example: Opening a new browser (say Chrome) is an example of creating a process. At this point, a new process will start to execute. opening multiple tabs in the browser is an example of creating the thread.

HTTP METHODS :

  • GET -> Used for fetching data, appending parameters in the URL, ideal for searches.

  • POST-> Used for updates, sends data securely in the request body, perfect for forms

  • PUT -> to put the data at specific location

  • DELETE -> to delete the data from the server

STATUS CODE: It helps us to know whether our request is accepted or not

1xx -> Information related

2xx-> Successful

3xx->Redirection purpose

4xx-> client error

5xx-> Server error

Cookies - > Cookies are small pieces of text sent to your browser by a website you visit.

HOW EMAIL WORKS?

It works with the help of SMTP protocol

WHAT IS DNS?

DNS -> Domain Name System

DNS is like the phone book of the internet, making it easier to search for websites by using words instead of numbers.

You can check it out from the following sites:

TRANSPORT LAYER :

The transport layer is responsible for reliable data transfer between devices on the network. It ensures that the data packets are delivered error-free, in the correct sequence, and without loss or duplication. There are two main protocols at the transport layer

  • Transmission Control Protocol (TCP): Provides reliable, connection-oriented communication. It ensures error recovery, flow control, and retransmission of lost packets.

  • User Datagram Protocol (UDP): Provides unreliable, connectionless communication. It does not guarantee the delivery of packets or their order but is faster due to the lack of overhead for reliability.

Key Functions of the Transport Layer:

  • Segmentation and Reassembly: The transport layer divides large messages into smaller packets and puts them back together at the destination.

  • Error Control: It detects and handles errors that occur during transmission.

  • Flow Control: It regulates the rate of data transmission to prevent congestion.

  • Connection Establishment and Termination: In protocols like TCP, the transport layer sets up, maintains, and ends connections.

Linux Commands for Transport Layer:

  • netstat: Displays the network connections, routing tables, and network interface statistics. Use it to see active TCP connections.

  • ss: A more modern tool than netstat, which provides detailed information about TCP, UDP sockets.

  • telnet / nc (Netcat): Used to test connectivity on specific ports. For instance, testing if a TCP connection to a server is available.

      1. netstat -tuln
      2. ss -tuln
      3. telnet <hostname> <port>
    

NETWORK LAYER:

  • Responsible for packet forwarding, routing, and addressing, including the use of IP addresses.

  • Linux Command: ping, traceroute, route, and ip commands are helpful for network diagnostics.

  • Linux Command: ping, traceroute, route, and ip commands are helpful for network diagnostics.

1. ping 192.168.1.1
2. traceroute www.google.com
3. ip route show
  • Ensures data transfer between adjacent network nodes and handles error detection and correction.

  • Linux Command: arp, ethtool, and iwconfig help in managing network interfaces.

1. arp -a
2. ethtool eth0

PHYSICAL LAYER:

  • Deals with the physical medium of data transmission like cables and network devices.

  • Linux Command: ifconfig or ip link can show the status of the network interfaces.

1. ifconfig
2. ip link show