CSEN2021 COMPUTER
NETWORKS
      UNIT I
What’s the Computer Network
  PC               •   Is connecting of millions of computing devices,
  server               running network apps.
  wireless
                         • Computing devices are hosts or end systems
  laptop                   namely PC, server, laptop, smartphone
  smartphone
               They       are connected by communication links
       wireless        Namely fiber, copper, radio, satellite cables
       links           with different
       wired
       links           transmission rate: bandwidth
                   forwardpackets (chunks of data) using
 router            switches using routers and switches
HOST
“Fun” Internet appliances
                                                 Web-enabled toaster +
                                                 weather forecaster
 IP picture frame
 http://www.ceiva.com/
                                                            Tweet-a-watt:
                                                            monitor energy use
                     Slingbox: watch,
                     control cable TV remotely
 Internet
 refrigerator                                      Internet phones
•   Internet: is connecting“network of
    networks”, by interconnecting ISP(Internet
    Service Provider)
•   protocols control sending, receiving of
    messages
     • e.g., TCP, IP,UDP, HTTP, Skype, 802.11
•   Internet standards
     • RFC: Request for comments
     • IETF: Internet Engineering Task Force
Internet Service Providers (ISPs)
•ISP is like a gateway that allows our devices connect to the Internet and
access online resources.
•ISPs operate in a hierarchy:
   • Tier-1 ISPs: Large backbone networks that interconnect globally.
   • Tier-2 ISPs: Regional providers that connect to Tier-1 ISPs.
   • Tier-3 ISPs: Local providers that connect end-users to the Internet.
                                                        mobile network
                                                                           global ISP
                                                            home
                                                            network
                                                                         regional ISP
                                                    institutional
                                                          network
          Internet structure: network of
          networks
                  Tier 1 ISP               Tier 1 ISP              Google
                           IXP                          IXP                      IXP
                             Regional ISP             Regional ISP
                access   access   access     access   access   access   access   access
                 ISP      ISP      ISP        ISP      ISP      ISP      ISP      ISP
• tier-1” commercial ISPs (e.g., Level 3, Sprint, AT&T, NTT), national &
  international coverage
• content provider network (e.g, Google): private network that connects it
  data centers to Internet
• An Internet Exchange Point (IXP) is a physical location where different Internet
Level 3 Communications (now part of
CenturyLink/Lumen):A      major     Tier-1
network provider offering global IP
transit and backbone connectivity.
Sprint (now part of T-Mobile):A
significant   telecom    and     Internet
provider with strong peering and transit
services.
AT&T:A large telecommunications and
Internet service provider with its global
network infrastructure.
NTT Communications:A Japanese-
based global network provider with
extensive peering and IP transit
services.
Tier 1 ISPs in India include: Bharti, Reliance, Tata, and VSNL. Tier 2 ISPs are similar to Tier 1s, however they aren't big enough
to connect to every network and so have to purchase transit from Tier 1.Example of Tier2 are Comcast, Cox, Charter
Communications, China Telecom, British Telecom, Vodafone, Virgin Media, and Softbank Japan. Tier 3 internet service
providers (ISPs) in India: Jio, Airtel, BSNL, and Vi.
IP (Internet Protocol):
   • IP (Internet Protocol) is a set of rules that govern how
     data packets are addressed, routed, and delivered across
     interconnected networks.
   • Two versions: IPv4 and IPv6.
•IPv4: 32-bit address (e.g., 192.168.1.1).
   • Supports about 4.3 billion addresses.
•IPv6: 128-bit address (e.g.,
2001:0db8:85a3:0000:0000:8a2e:0370:7334).
   • Supports 3.4×10³⁸ addresses, designed to handle the
     growing number of Internet-connected devices.
IPV6 FORMAT
Domain Name System (DNS)
•DNS maps domain names (e.g., www.google.com) to IP addresses.
•Example:
   • Domain: www.google.com
   • IP Address: 142.250.190.14
MAC Address
•The MAC (Media Access Control) address is a hardware address
assigned to a network interface card (NIC).
•NIC is a hardware component that connects devices to a network.
• IP addresses are logical and changeable, MAC addresses are
permanent and unique for each device.
How Data Travels on the Internet
1.Packet Creation:
   1. Data is split into packets, each containing a header (addressing information) and a
      payload (data).
2.Routing:
   1. Packets travel from the source to the destination via routers using routing algorithms
      (e.g., Link State, Distance Vector).
3.Reassembly:
   1. At the destination, packets are reassembled into the original data.
•TCP (Transmission Control Protocol): 3 way handshake protocol
   • Ensures reliable delivery of data packets with error checking.
 SYN (Synchronize):
 •The client sends a TCP segment with the
 SYN flag set and an initial sequence
 number (ISN).
 SYN-ACK (Synchronize-
 Acknowledge):
 •The server responds with a TCP segment
 with both SYN and ACK flags set.
 ACK (Acknowledge):
 •The client responds with an ACK
 segment, acknowledging the server’s
 ISN(Initial Sequence Number
 represents starting point for a sequence
 of bytes, ensuring order of data
 segment and error recovery through
 retransmission).
•UDP (User Datagram Protocol):
   • Used for faster, connectionless communication (e.g., video streaming).
Client Request:
•The client sends a UDP packet to the server with a request (e.g., a query
or command).
Server Response:
•The server processes the received request.
•   Infrastructure that provides services to applications:
     • Web, VoIP(Voice over Internet Protocol ), email, games, e-
       commerce, social nets, …
•   An application programming interface (API) is a set of
    rules that allows software applications to communicate with
    each other.
What’s a protocol?      protocols are set of rules, define format, order of
messages actions taken on message transmission, receipt among network
entities
           a human protocol and a computer network protocol:
                   Hi                      TCP connection
                                              request
                   Hi                      TCP connection
                                             response
                 Got the
                  time?                    Get http://www.awl.com/kurose-ross
                  2:00
                                                 <file>
                                time
            Q: other human
              protocols?
      Physical media
      refers to the physical medium through which data is transmitted from one device to another within a network.
•   bit: propagates between transmitter/                           Twisted pair (TP)
    receiver pairs                                                 Twisted Pair cables are used in
                                                                     telephone lines to provide data and
•   physical link: what lies between                                 voice channels.
    transmitter & receiver
                                                                   Example two insulated copper wires
•   guided media: (wired communication or                             • Category 5: 100 Mbps, 1 Gpbs
    bounded transmission media)                                         Ethernet
      • The signal energy propagates through                          • Category 6: 10Gbps
        wires in guided media. : copper,
        fiber, coax
•   unguided media: (wireless
    communication or unbounded
    transmission media)
      • The signal energy propagates through
        the air in unguided media e.g., radio
coaxial cable:                          fiber optic cable:
                                         is made of glass fiber and
  is a type of guided media made
  of Plastics, and copper wires which       transmit data signals as light
  transmit the signal in electrical         used for long-distance and
  form                                      high-performance data
Example:two concentric copper               networking.
conductors                                 high-speed operation:
                                             high-speed point-to-point
• bidirectional
                                              transmission (e.g., 10’s-100’s
• broadband:                                  Gpbs transmission rate)
    • multiple channels on cable           low error rate
    • HFC
          NETWORK EDGE
•   Network edge: network edge is where your device connects
    to the Internet to send and receive information.
     • Devices are Hosts(end system) namely clients and servers
            access networks, physical media
             are either wired, wireless
             communication links
            Network Core:
               interconnecting routers to routers from
              network of networks
Q: How to connect end systems
 to edge router?
•   residential access nets
•   institutional access networks
    (school, company)
•   mobile access networks
•   Bandwidth of access network?
•   Is maximum amount of data that
    can be transmitted over a network. It
    is measured in bits per
    second(Mbps or Gbps)or Mega bits
    per second or Giga bits per second
How the Network Edge Works
•The network edge works by connecting end devices (like laptops,
smartphones, and IoT devices) to the Internet through access networks
(e.g., Wi-Fi, DSL, 4G/5G). It enables these devices to send data (e.g., web
requests) and receive responses (e.g., website content) by communicating
with the network core(routers), which routes the data to its destination.
               Access net: digital subscriber line (DSL)
DSL is used to transmit digital data over traditional telephone lines
(copper wires).
                                                            central office   telephone
                                                                             network
                                  DSL splitter
                                 modem                      DSLAM
                                                                                    ISP
                            voice, data transmitted
                     at different frequencies over    DSL access
                   dedicated line to central office    multiplexer
  
      DSLAM(acts   as a central point where multiple customer DSL lines (from homes or
      businesses) are aggregated and connected to a larger backbone network, ISP)
         data over DSL phone line goes to Internet
         voice over DSL phone line goes to telephone net
     < 2.5 Mbps upstream indicates direction of data transfer(Data flows from the client to the
      server), transmission rate (typically < 1 Mbps)
     < 24 Mbps downstream(Data flows from the server to the client) ,transmission rate
      (typically < 10 Mbps)
     Transmission Rate is the speed at which data is transmitted across a network
             Access net: cable
             network
                                                                    cable headend
                   cable splitter
                  modem
                                                                    C
                                                                    O
                                    V   V   V   V   V   V           N
                                    I   I   I   I   I   I   D   D   T
                                    D   D   D   D   D   D   A   A   R
                                    E   E   E   E   E   E   T   T   O
                                    O   O   O   O   O   O   A   A   L
                                    1   2   3   4   5   6   7   8    9
                                            Channels
frequency division multiplexing: is a method of dividing a communication channel's
bandwidth into smaller channels. Different channels transmitted in different frequency
bands.
An example is Cable Television (CATV).
         Access net: cable
         network
                                                  cable headend
                  cable splitter                                        cable modem
                 modem                               CMTS          termination system
         data, TV transmitted at different
          frequencies over shared cable                           ISP
                      distribution network
   HFC: hybrid fiber coax is a network technology that combines fiber optic cables
    and coaxial cables to provide high-speed internet and other services
      Asymmetric(communication type where the data transmission rates for upstream and
       downstream traffic are different. ): up to 30Mbps downstream transmission rate, 2
       Mbps upstream transmission rate
   network of cable, fiber attaches homes to ISP router
      homes share access network to cable headend
      CMTS allow cable modem to send and receive packets over internet
  Access net: home
  network
          wireless
          devices
                                                  to/from headend or
                                                      central office
often combined
    in single box
                                       cable or DSL modem
    wireless access       router, firewall, NAT
    point (54 Mbps)
                      wired Ethernet (100 Mbps)
Enterprise access networks (Ethernet)
                                              institutional link to
                                                 ISP (Internet)
                                            institutional router
                   Ethernet           institutional mail,
                    switch              web servers
• typically used in companies, universities, etc
 10 Mbps, 100Mbps, 1Gbps, 10Gbps transmission rates
 end systems connect into Ethernet switch
              Wireless access networks
             • shared wireless access network connects end
               system to router
                                               wide-area wireless access
                via base station or “access point”
              wireless LANs:                       
                     within building (100 ft)    provided by telco (cellular)
                                                  operator, 10’s km( distances on
                     802.11b/g (WiFi): 11, 54    the order of tens of kilometers e.g., 10
                      Mbps transmission rate      km, 20 km, 30 km, etc.).
                                                  between 1 and 10 Mbps
          1 , 000                                 3G, 4G: LTE(Long Term
      s =
1 kbp                                              Evolution)
bps
        s = 1,000
      p
 1 Mb
 kbps
                             to Internet
                                                                to Internet
Network core
   • mesh of
     interconnected
     routers
   • packet-switching:In
    application-layer, host
    breaks messages into
    packets and forward
    packets from one router
    to the next, across links
    on path from source to
    destination
      • each packet
        transmitted at full link
        capacity
Network-core functions
   routing: determines                           forwarding: move
   source-destination route                      packets from router’s
   taken by packets                              input to appropriate
       routing algorithms                       router output
             routing algorithm
           local forwarding table
          header value output link
                  0100   3                                  1
                  0101   2
                  0111   2                              3 2
                  1001   1
                                                 1
                                              011
                                 dest address in arriving
                                 packet’s header
Difference Between Network Edge and
Network Core
      Aspect        Network Edge                 Network Core
                    Connects end-users to the    Transports data between
      Purpose
                    network                      networks
                    End systems (laptops,
      Devices                                    Routers, switches
                    phones)
                    Lower speeds (e.g., DSL,     High-speed (fiber-optic
      Speed
                    Wi-Fi)                       links)
                                                 Transfers between
      Data Flow     Starts or ends at the edge
                                                 networks
             How delay occur?
•   Delay refers to the time taken for a packet of data to travel from the
    source to the destination across a network
•   Types of Delay:1.Transmission Delay 2.Propogation delay 3.Queuing delay 4.
    Processing Delay
                                             packet being transmitted (delay)
                    B
                                           packets queueing (delay)
                            free (available) buffers: arriving packets
                            dropped (loss) if no free buffers
•   1.Transmission Delay: Time it takes for a sender to push the packet onto the link.
•   2.Propagation Delay: Time for the signal to travel through the physical medium to the
    next device.
                                    transmission
                         A                           propagation
                           B
                                         nodal
                                      processing   queueing
                             dnodal = dproc + dqueue + dtrans +
                               dprop
                dtrans: transmission                dprop: propagation delay:
                   delay:                            d: length of physical link
                 L: packet length (bits)            s: propagation speed in
                 R: link bandwidth (bps)             medium (~2x108 m/sec)
                 dtrans = L/R dtrans and dprop      dprop = d/s
                               very different
3.Queueing delay
Packets wait in the router's buffer (queue) until
they can be forwarded.
                              average queueing
 • R: link bandwidth
                                     delay
   (bps)
 • L: packet length
   (bits)
 • a: average packet           traffic intensity
   arrival rate                      = La/R
  La/R ~ 0: avg. queueing delay small              La/R ~ 0
  La/R -> 1: avg. queueing delay large
  La/R > 1: more “work” arriving
    than can be serviced, average delay
    infinite!
                                                       La/R -> 1
Caravan analogy
                                100 km                   100 km
        ten-car       toll                    toll
        caravan      booth                   booth
•   cars “propagate” at                   time to “push” entire
    100 km/hr                              caravan through toll booth
                                           onto highway = 12*10 =
•   toll booth takes 12 sec to             120 sec
    service car (bit transmission
                                          time for last car to
    time)
                                           propagate from 1st to 2nd
•   car~bit; caravan ~ packet              toll both:
•   Q: How long until caravan is          Time=Distance/speed
    lined up before 2nd toll               100km/(100km/hr)= 1 hr
    booth?                                A: 60 minutes
4. Processing Delay: refers to the time a network device (such as a
router or switch) takes to process the header of a packet, perform
error checking, and determine the next hop for the packet before
forwarding it.
Example of Processing Delay
Suppose a packet arrives at a router. The router takes:
•0.2 ms to inspect the header.
•0.1 ms to check for errors (CRC).
•0.3 ms to perform route lookup.
The total processing delay at this router is:
Processing Delay=0.2+0.1+0.3=0.6 ms
“Real” Internet delays and routes
•   traceroute program: provides
    delay measurement from source
    to router along end-end Internet
    path towards destination.
       3 probes        3 probes
            3 probes
cmd prompt, C:\Users\sylaj>tracert 172.24.10.5
Tracing route to XXX.GITAM.EDU [172.24.10.5]
over a maximum of 30 hops:
 1 <1 ms <1 ms <1 ms SYLAJASAJU.GITAM.EDU [172.22.162.22]
Trace complete.
Note:
Hop Number (1): Indicates this is the first step (or hop) in the network path to the
destination.
<1 ms <1 ms <1 ms: These are the round-trip times (RTT is the time taken for a signal or
data packet to travel from the sender to the receiver and back to the sender. ) for three
packets sent to the first hop.
 Loss
Packet loss occurs when packets arrive at the
 router but cannot be processed or forwarded
 because the router's buffer is full(OR )arrival
 rate to link (temporarily) exceeds output link
 capacity
                   buffer
                (waiting area)    packet being transmitted
        A
            B
                       packet arriving to
                       full buffer is lost
 Throughput
   • throughput: rate (bits/time unit) at which bits
     transferred between sender/receiver
   Let
   • Rc: Capacity of the Receiver's Network Link
   • Rs: Capacity of the Sender's Network Link
   server,   with
    server sends       link capacity
                          pipe that can carry link capacity
                                                 pipe that can carry
   file ofbits
           F bits            fluid at rate
                         Rs bits/sec                fluid at rate
                                                Rc bits/sec
to(fluid)
    send into
           to client
                pipe          Rs bits/sec)           Rc bits/sec)
A bottleneck occurs when the capacity of a network
component (e.g., link, router, or server) is lower than the
demand placed on it.
In a network
 If Rs < Rc, the sender's link speed becomes the bottleneck,
  meaning the sender cannot send data as fast as the
  receiver can process it.
 If Rc < Rs, the receiver’s link speed becomes the
  bottleneck, meaning the receiver cannot process incoming
  data as fast as the sender sends it.
Per-connection end-end throughput=
 min(Rc, Rs, R/10)
This assumes that the total available              Rs
bandwidth is evenly divided among         Rs
10 simultaneous connections.                                       Rs
                                                            R
R: link bandwidth. It represents the
maximum transmission capacity of          Rc                        Rc
the shared network link
                                                     Rc
Rc: Receiver Network Link
Rs: Sender Network Link
                                           10 connections (fairly) share
                                        backbone bottleneck link R bits/sec
Layering of airline
functionality
ticket (purchase)                                            ticket (complain)   ticket
baggage (check)                                              baggage (claim      baggage
  gates (load)                                                gates (unload)     gate
runway (takeoff)                                              runway (land)      takeoff/landing
airplane routing    airplane routing      airplane routing   airplane routing    airplane routing
   departure                intermediate air-traffic              arrival
    airport                     control centers                   airport
layers: each layer implements a service
   • via its own internal-layer actions
   • relying on services provided by layer below
Protocol Layers and Their Service
Models
• The communication process is
  divided in to layers, as the OSI Model
  or TCP/IP Model.
• Each layer defines a service model
  that specifies what services it
  provides to the upper layer.
• For example, the Transport Layer
  provides reliable data delivery to the
  Application Layer.
Internet protocol
stack(TCP/IP)
•   application: supporting network
    applications
     • FTP, SMTP, HTTP                   application
•   transport: process-process data
    transfer                             transport
     • TCP, UDP
•   network: routing of datagrams from    network
    source to destination
     • IP, routing protocols                link
•   link: data transfer between
    neighboring network elements          physical
     • Ethernet, 802.111 (WiFi), PPP
•   physical: bits “on the wire”
OSI(Open System Interconnect)Model
The OSI Model (Open Systems Interconnection) is a conceptual framework that divides network
communication into 7 layers
ISO/OSI reference
model
•   presentation: allow applications
    to interpret meaning of data,      application
    e.g., encryption, compression,     presentation
    machine-specific conventions
                                         session
•   session: synchronization,
    checkpointing, recovery of data     transport
    exchange                             network
                                           link
                                         physical
Real-World Example: Loading a Web Page
1.Application Layer: You type a URL in your browser.
2.Presentation Layer: Data is formatted into HTTP requests.
3.Session Layer: The connection to the web server is established.
4.Transport Layer: The data packets are managed using TCP.
5.Network Layer: The packets are routed to the server via IP.
6.Data Link Layer: The packets are sent over a single link using MAC
addresses.
7.Physical Layer: The bits are transmitted over your Wi-Fi or cable.
History of computer networking and the Internet
8. Early Days (1950s-1960s): Standalone ComputersComputers were
   big and used for individual tasks only. Scientists started thinking about
   connecting computers to share information. Example: Imagine two
   researchers wanting to share data but having to physically exchange
   punch cards.
9. ARPANET: The First Network (1969)The U.S. Department of Defense
   created ARPANET, the first network to connect multiple computers
   using packet switching. Initially connected four universities. Example:
3. The Birth of TCP/IP (1970s)A new communication protocol, TCP/IP,
was developed to allow computers on different networks to talk to each
other.This became the foundation of the modern Internet.Example:
Computers in different cities exchanging emails seamlessly.
4. Local Area Networks (1980s)Companies and universities began
setting up smaller networks like Ethernet within their buildings.The
Domain Name System (DNS) was created, so people could use easy
names       (e.g.,  www.google.com)      instead    of    numbers   (IP
addresses).Example: Offices using Ethernet to connect computers and
share printers.
5. The World Wide Web (1990s)Tim Berners-Lee invented the World
Wide Web (WWW), which allowed people to access information through
hyperlinks and browsers like Mosaic.Internet became available to the
public.Example: Visiting a website to read news or send emails for the
first time.
6. Mobile and Fast Internet (2000s)Internet speeds increased with
broadband and mobile networks (like 3G and 4G).People started using
smartphones to browse the Internet.Example: Watching YouTube videos or
Internet history
1961-1972: Early packet-switching
principles
•   1961: Kleinrock -     •   1972:
    queueing theory            • ARPAnet public demo
    shows effectiveness        • NCP (Network Control
    of packet-switching          Protocol) first host-host
•   1964: Baran -                protocol
    packet-switching in        • first e-mail program
    military nets              • ARPAnet has 15 nodes
•   1967: ARPAnet
    conceived by
    Advanced Research
    Projects Agency
•   1969: first ARPAnet
    node operational
    1972-1980: Internetworking, new and proprietary
    nets
•   1970: ALOHAnet satellite
    network in Hawaii              Cerf and Kahn’s
•   1974: Cerf and Kahn -           internetworking
    architecture for                principles:
    interconnecting networks          • minimalism, autonomy
•   1976: Ethernet at Xerox PARC        - no internal changes
                                        required to
•   late70’s: proprietary               interconnect networks
    architectures: DECnet, SNA,
                                      • best effort service
    XNA
                                        model
•   late 70’s: switching fixed        • stateless routers
    length packets (ATM               • decentralized control
    precursor)
•   1979: ARPAnet has 200 nodes    define today’s Internet
                                    architecture
1980-1990: new protocols,   a proliferation of
networks
• 1983: deployment of   •   new national
  TCP/IP                    networks: Csnet,
• 1982: smtp e-mail         BITnet, NSFnet,
  protocol defined          Minitel
• 1983: DNS defined for
                        •   100,000 hosts
  name-to-IP-address        connected to
  translation               confederation of
                            networks
• 1985: ftp protocol
  defined
• 1988: TCP congestion
  control
    1990, 2000’s: commercialization, the Web,
    new apps
•   early 1990’s: ARPAnet             late 1990’s – 2000’s:
    decommissioned
                                      • more killer apps:
•   1991: NSF lifts restrictions on     instant messaging,
    commercial use of NSFnet
    (decommissioned, 1995)
                                        P2P file sharing
                                      • network security to
•   early 1990s: Web
     • hypertext [Bush 1945,            forefront
       Nelson 1960’s]                 • est. 50 million host,
     • HTML, HTTP: Berners-Lee          100 million+ users
     • 1994: Mosaic, later            • backbone links
       Netscape
                                        running at Gbps
     • late 1990’s:
       commercialization of the
      Web
2005-present
•   ~750 million hosts
     •   Smartphones and tablets
• Aggressive deployment of broadband access
• Increasing ubiquity of high-speed wireless access
• Emergence of online social networks:
     • Facebook: soon one billion users
• Service providers (Google, Microsoft) create their
  own networks
   • Bypass Internet, providing “instantaneous”
     access to search, emai, etc.
• E-commerce, universities, enterprises running their
  services in “cloud” (eg, Amazon EC2)
Network security
• Network Security refers to practices
  and technologies designed to
  protect data, devices, and networks
  from unauthorized access, attacks,
  and damage.
• Example: Firewalls and antivirus
  software are common tools used to
  enhance     network    security   by
  blocking malicious traffic and
  detecting threats.
Bad guys: put malware into hosts via
Internet
 •   malware can get in host from:
      •   virus: self-replicating infection by
          receiving/executing object (e.g., e-mail
          attachment)
      •   worm: self-replicating infection by passively
          receiving object that gets itself executed
 •   spyware malware can record keystrokes,
     web sites visited, upload info to
     collection site
 •   infected host can be enrolled in botnet,
     used for spam. DDoS attacks
Bad guys: attack server, network
infrastructure
Denial of Service (DoS): attackers make resources
 (server, bandwidth) unavailable to legitimate
 traffic by overwhelming resource with bogus traffic
1. select target
2. break into hosts
   around the network
   (see botnet)
3. send packets to target
   from compromised
   hosts                              target
   Bad guys can sniff packets
packet “sniffing”:
  • broadcast media (shared ethernet, wireless)
  • promiscuous network interface reads/records all
    packets (e.g., including passwords!) passing by
           A                               C
                            src:B dest:A   payload
                                                     B
          wireshark software used for end-of-chapter
           labs is a (free) packet-sniffer
   Bad guys can use fake
   addresses
   IP spoofing: send packet with false source address
          A                               C
                 src:B dest:A   payload
… lots more on security (throughout, Chapter 8)