Computer Networks - Episode 1

Computer Networks - Episode 1

Agenda for today!

  • What is Internet
  • Protocol
  • Layered Architecture
    • OSI Model
    • TCP/IP Model

Network : Group of interconnected things. Internet is a network of computers.

Why do we need to connect computers?

  • Communication
  • Sharing Resources
    • Ex: AWS. We are sharing compute. We are sharing CPU. We are sharing memory, database etc etc.

Protocol : Analogous to language in humans. Protocols allow computer to communicate with each other. A set of rule that govern how 2 computers talk. Protocols:Grammar

ex:

  • HTTP : This is a protocol that a browser uses to talk with the web servers. Browser sends an HTTP request. Severs understand an HTTP request.
  • HTTPS
  • FTP(Not used much theese days)
  • IP (Internet Protocol) : How internet works. So basically Internet protocol defines how internet is going to talk.

For the internet, where are theese protocols defined, where can someone see the set of rules? These protocols are defined as RFCs. ( Request for Comments). If someone wants to define a protocol, he has to submit a talk on it. Where to upload this RFCs? These are uploaded at IETF ( Internet Engineering Task Force ). You can create your RFCs but it depends on people to use it.

This is the source of truth: rfc-editor.org/rfc/rfc2069.html

rfc-editor.org

try to think of every RFC as a research paper.

If you understand how Post Office works you wil be able to understand how IP works. There's huge similarity between how post office works & internet works. While I say things try to relate to Post Office.

Let's say a computer in Atlanta wants to connect with a computer in Bihar. How do you think they're gonna connect? Will they use address as people of Bihar use (Behind gopal's khet)? How will computer understand theese adresses?

How does Adressing in Computer Networks happen? Network Adressing : Over the internet there are 2 ways in which we give the addresses.

  • ipv4: Dotted Decimal notation.32 bits. ex:192.168.1.1
  • ipv6: 128 bit address These kind of adresses are used in computers so that one can talk to each other. Every computer has an IP address attached to it. If you are connected to an internet then only you will have an IP address. Even a LAN is a network of computers. Even a TV has an address. Even a bulb,AC has an address. Everything is connected to internet

PORT: every process that wants to talk via the internet, gets assigned a port. 16 Bit Integer. 2 to the power 16 ports. i.e 65535 ports. 0-1023 : Reserved for well known applications. Well known applications : Theese are applications that are bones of internet. For rx HTTP:80 (default port) HTTPS: 443 FTP:21 or 23

Protocols can be at any level. There can be an application level protocol, network level protocol etc.

Any HTTP request that you send on the browser, actually goes to port 80. Even HTTP is an application. HTTP is an application level protocol.

Devices on the Internet

  • Edge Systems: The person who sneds the request & the server which receives the request are known as edge systems.
  • Edge Routers: Router that is at the edge of the internet
  • Laptops need something to connect to internet. There is a chip or there is a adapter that is there inside every computer & that is knwon as a Network interface Adapater. This adapter allows your computers to connect over the internet. People also call it Network card. If your laptop doesn't have this network adapter or a network card, the laptop will not be able to connect . This is a hardware device. Similarly for every type of medium via which you want to connect to the internet there is a separate hardware device. For ex: On laptop, what are the diff ways to connect to the internet? Wifi, LAN. For each of theese there will be a different adapter. Each adapter has something called a MAC address. This is also known as a physical address.
    • So now there are 2 adresses. 1 is the address to connect over the internet i.e IP address. The 2nd is a hardware address. It's not use dover internet. It's mac address.
    • Why we need MAC address? Whenever you connect to the internet, MAC address is used to identify your machine, like which is the MAC address connected to the machine
    • If you use internet at 2 diff places, your IP address will not be the same. Your MAC addresss will be same.
    • Everything that allows you to connect to internet has an mac address.
    • MAC address is the adress of the adapter, not of computer.
  • Wires: Submarines Cable Map

Internet Speed

When you buy 100mbps internet. When you buy the internet we buy mbps, not capital B mBps. We buy bits per second. But whenever we download we see bytes per second.

In Internet, data is sent as bits and that is why internet speed is measure in bits per seconds.

1 kilobits = 1000 bits. not bytes.

Asymmetric Transmission Rate : It happens mostly because upload requests are much less than the downloads.

How Internet works?

Layering Architecture

Vertical

  1. Lower layers provide sercice to upper ones.
  2. Upper layers choose features & don't care abhot how those sercices work.

    Horizontal

  3. Corresponding layer on other side knows how to interpret the data of other side.

Whenever we have layering architecture, there are horizontal relations & vertical relations. This is the architecture behind internet.

Internet has a layered architecture.

OSI Model

7 layers This layering was made before the Internet came into existence. Was a research. This was a theoretical model that researchers came up with. We use the TCP/IP model.

  • Sender
    • Application : Creating data
    • Presentation : Compression, encoding
    • Session
  • Postman
    • Transport
  • Post Office
    • Network
  • Indigo Office
    • Data Link
  • Aeroplane
    • Physical
  1. Application Layer
    • Software Layer
    • Used by end users to interact
    • Ex: Chrome, Firexfox, Email
    • Create/receieve data from/for user.
  2. Presentation Layer
    • Encoding, Encryption, Compression
  3. Session Layer
    • Manage user session betweekn 2 end systems. ex: tokens
    • Often the data will be sent many times, so we can remeber this.
  4. Transport Layer
    • Divides the data into chunks
    • These chunks are known as Datagrams (if you are using UDP). UDP is 1 of the protocol of transport layer.
    • These chunks are known as Segments (if you are using TCP).
    • It has checksums to check correctness of data at the receiving side.
    • After this layer, it's going to session basically application layer, it also ensures order of delivery. (TCP) TCP is slower because it tries to maintain order of delivery
  5. Network Layer
    • Routing
    • Routing protocols run on this layer
    • Internet exixts here
    • This is the 1st layer where we start talking with the outer system.
    • It sends in forms of packets. In the network layer messages are called packets.
    • For each of the packet network layer will decide how to route it & send it as well.
  6. Data Link Layer
    • Communication between 2 directly connecte hosts.
    • When you send the data over the data link layer, do you think that only 1 application will be sending the data over that layer? Probably no. There are going to be multiple application that will be sending data over this layer.
    • Directly interacts with hardware layer.
    • Flow Control : This talks about how much data should I send here. Should I send now/ Should I send later. Should i send it with full speed/slower speed etc.
    • Transmission Conflicts: It will manage this which may occur due to physical layer in the wires.
    • Error Detection/Correction
  7. Physical Layer
    • Hardware / Medium via which communications happen.
    • Complete hardware layer
    • Can be Wifi, wire(fiber ,copper), satellite

TCP/IP Model

  • Model of the Internet. This is how Internet is really structured.
  • It came out of practice
  • Developed as each layer matured
  • 5 Layers
    • Application
    • Transport
    • Network
    • Data Link
    • Physical
  • Theese layers communicate both horizontally & vertically via headers.
  • Each layer adds the header on sender side.
  • On receiver side reverse happens. They get their data & delete their own headers.

What we did?

  • What are layering architectures?
    • Vertical & Horizontal communication
  • OSI model
  • TCP model
  • Properties of each layers of each models.

What's next?

  • How each layer works?
  • A few protocols of each layer This sums up our Computer Networks.