National University of
Computer & Emerging Sciences
CS 3001 – COMPUTER NETWORKS
Lecture 06
Chapter 1 & Chapter 2
8th September, 2022
Nauman Moazzam Hayat
[email protected]Office Hours: 02:30 pm till 06:00 pm (Every Tuesday & Thursday)
Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
▪ end systems, access networks, links
1.3 network core
▪ packet switching, circuit switching, network structure
1.4 delay, loss, throughput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history
Protocol “layers”
Networks are complex,
with many “pieces”:
▪ hosts Question:
▪ routers is there any hope of
▪ links of various organizing structure of
network?
media
▪ applications …. or at least our discussion
▪ protocols of networks?
▪ hardware,
software
Organization of air travel
ticket (purchase) ticket (complain)
baggage (check) baggage (claim)
gates (load) gates (unload)
runway takeoff runway landing
airplane routing airplane routing
airplane routing
❖ a series of steps
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
The Path Through FedEx
Higher “Stack”
at Ends Partial “Stack”
Truck During Transit Truck
FE FE FE
Sorting Sorting Sorting
Office Office Office
Crate Crate New
Crate
Crate
Airport Airport Airport
Deepest Packaging (Envelope+FE+Crate)
at the Lowest Level of Transport
Why layering?
dealing with complex systems:
❖ explicit structure allows identification,
relationship of complex system’s pieces
▪ layered reference model for discussion
❖ modularization eases maintenance, updating of
system
▪ change of implementation of layer’s service
transparent to rest of system
▪ e.g., change in gate procedure doesn’t affect rest of
system
❖ layering considered harmful?
Internet protocol stack
❖ application: supporting network
applications
▪ FTP, SMTP, HTTP application
❖ transport: process-process data
transfer transport
▪ TCP, UDP
❖ network: routing of datagrams network
from source to destination
▪ IP, routing protocols
link
❖ link: data transfer between
neighboring network elements
▪ Ethernet, 802.111 (WiFi), PPP physical
❖ physical: bits “on the wire”
ISO/OSI reference model
❖ presentation: allow applications
to interpret meaning of data, application
e.g., encryption, compression,
machine-specific conventions presentation
❖ session: synchronization, session
checkpointing, recovery of data transport
exchange
network
❖ Internet stack “missing” these
layers! link
▪ these services, if needed, must be physical
implemented in application
▪ needed?
Simple Diagram
❖ Lower three layers implemented everywhere
❖ Top two layers implemented only at hosts
Application Application
Transport Transport
Network Network Network
Datalink Datalink Datalink
Physical Physical Physical
End system Router End system
Logical Communication
❖ Layers interacts with peer’s corresponding layer
Application Application
Transport Transport
Network Network Network
Datalink Datalink Datalink
Physical Physical Physical
Host A Router Host B
Physical Communication
❖ Communication goes down to physical network
❖ Then up to relevant layer
Application Application
Transport Transport
Network Network Network
Datalink Datalink Datalink
Physical Physical Physical
Host A Router Host B
Protocols at different layers
L7 Application SMTP HTTP DNS NTP
L4 Transport TCP UDP
L3 Network IP
L2 Data link Ethernet FDDI PPP
L1 Physical optical copper radio PSTN/DSL
There is just one network-layer protocol!
Why layers?
‣ Reduce complexity
‣ Improve flexibility
Why not?
‣ sub-optimal performance
‣ cross-layer information often useful
➢ several “layer violations” in practice
message M
source
application
Encapsulation
segment Ht M transport
datagram Hn Ht M network
frame Hl Hn Ht M link
physical
link
physical
switch
destination Hn Ht M network
M application Hl Hn Ht M link Hn Ht M
Ht M transport physical
Hn Ht M network
Hl Hn Ht M link router
physical
Introduction: summary
covered a “ton” of material! you now have:
❖ Internet overview ❖ context, overview, “feel”
❖ what’s a protocol? of networking
❖ network edge, core, access ❖ more depth, detail to
network follow!
▪ packet-switching versus
circuit-switching
▪ Internet structure
❖ performance: loss, delay,
throughput
❖ layering, service models
❖ security
❖ history
Network classification by size
❖ Networks can be classified roughly by their physical size
▪ Personal area networks => E.g. Bluetooth
▪ Local area networks => E.g. University Campus network
▪ Metropolitan area networks => E.g. cable television networks
▪ Wide area networks => FAST campuses interconnectivity
Network topologies
❖ physical topology refers to the way in which a network is laid
out physically
▪ Two or more devices connect to a link; two or more links form a
topology
▪ Four types of topologies
• Mesh
• Bus
• Star
• Ring
Network topologies
▪ Mesh: point-to-point link between every two devices
• Total links: n(n-1)/2
• Disadvantage: not scalable & expensive
▪ Star: each device connected to centrally located hub
• Less expensive
• Disadvantage: failure of hub, failure of entire network
star
mesh
Network topologies
▪ Bus: Devices connected by a common link called bus/backbone
• Each message is broadcasted on bus
• Ease of installation
• Disadvantage: failure of bus, failure of network
▪ Ring: devices connected via an one sided signal
• Easy to install and reconfigure
• Disadvantage: failure of any device fails the entire network.
• Can be solved by adding dual rings which is of course expensive
ring
bus
End of chapter 1
Chapter 2
Application Layer
A note on the use of these ppt slides:
We’re making these slides freely available to all (faculty, students, readers). Computer
They’re in PowerPoint form so you see the animations; and can add, modify,
and delete slides (including this one) and slide content to suit your needs. Networking: A Top
They obviously represent a lot of work on our part. In return for use, we only
ask the following: Down Approach
❖ If you use these slides (e.g., in a class) that you mention their source
(after all, we’d like people to use our book!)
6th edition
❖ If you post any slides on a www site, that you note that they are adapted Jim Kurose, Keith Ross
from (or perhaps identical to) our slides, and note our copyright of this
material.
Addison-Wesley
March 2012
Thanks and enjoy! JFK/KWR
All material copyright 1996-2012
J.F Kurose and K.W. Ross, All Rights Reserved
Application Layer 2-29
Chapter 2: outline
2.1 principles of network 2.6 P2P applications
applications 2.7 socket programming
2.2 Web and HTTP with UDP and TCP
2.3 FTP
2.4 electronic mail
– SMTP, POP3, IMAP
2.5 DNS
Application Layer 2-30
Chapter 2: application layer
our goals: • learn about protocols by
• conceptual, examining popular
implementation aspects application-level
of network application protocols
protocols – HTTP
– transport-layer – FTP
service models – SMTP / POP3 / IMAP
– DNS
– client-server
paradigm • creating network
– peer-to-peer applications
paradigm – socket API
Application Layer 2-31
Some network apps
• e-mail • voice over IP (e.g., Skype)
• web • real-time video
• text messaging conferencing
• remote login • social networking
• P2P file sharing • search
• multi-user network games • …
• streaming stored video • …
(YouTube, Hulu, Netflix)
Application Layer 2-32
Creating a network app application
transport
network
data link
physical
write programs that:
• run on (different) end systems
• communicate over network
• e.g., web server software
communicates with browser
software
no need to write software for application
transport
network-core devices network
data link application
physical transport
• network-core devices do not network
data link
run user applications physical
• applications on end systems
allows for rapid app
development, propagation
Application Layer 2-33
Application architectures
possible structure of applications:
• client-server
• peer-to-peer (P2P)
Application Layer 2-34
Client-server architecture
server:
• always-on host
• permanent IP address
• data centers for scaling
clients:
• communicate with server
client/server • may be intermittently
connected
• may have dynamic IP addresses
• do not communicate directly
with each other
Application Layer 2-35
P2P architecture
• no always-on server peer-peer
• arbitrary end systems directly
communicate
• peers request service from
other peers, provide service in
return to other peers
– self scalability – new
peers bring new
service capacity, as
well as new service
demands
• peers are intermittently
connected and change IP
addresses
– complex management
Application Layer 2-36
Processes communicating
process: program running clients, servers
within a host client process: process
• within same host, two that initiates
communication
processes communicate
using inter-process server process: process
communication (defined by that waits to be contacted
OS)
• processes in different hosts ❖ aside: applications with P2P
communicate by architectures have client
exchanging messages processes & server
processes
Application Layer 2-37
How do we distinguish between two or
more processes running on the same
host?
Port Numbers
Sockets
• process sends/receives messages to/from its socket
• socket analogous to door
– sending process shoves message out door
– sending process relies on transport infrastructure on
other side of door to deliver message to socket at
receiving process
application application
socket controlled by
process process app developer
transport transport
network network controlled
link by OS
link Internet
physical physical
Application Layer 2-39
Addressing processes
• to receive messages, • identifier includes both IP
process must have address and port numbers
identifier associated with process on
• host device has unique 32- host.
bit IP address • example port numbers:
• Q: does IP address of host – HTTP server: 80
on which process runs – mail server: 25
suffice for identifying the • to send HTTP message to
process? gaia.cs.umass.edu web
server:
▪ A: no, many processes
can be running on same – IP address: 128.119.245.12
host – port number: 80
• more shortly…
Application Layer 2-40
number
Chapter 2: outline
2.1 principles of network 2.6 P2P applications
applications 2.7 socket programming
2.2 Web and HTTP with UDP and TCP
2.3 FTP
2.4 electronic mail
– SMTP, POP3, IMAP
2.5 DNS
Application Layer 2-44
What transport service does an app need?
data integrity throughput
• some apps (e.g., file transfer, ❖ some apps (e.g.,
web transactions) require multimedia) require
100% reliable data transfer minimum amount of
• other apps (e.g., audio) can throughput to be
tolerate some loss “effective”
❖ other apps (“elastic apps”)
timing make use of whatever
throughput they get
• some apps (e.g., Internet
telephony, interactive security
games) require low delay
to be “effective” ❖ encryption, data integrity,
…
Application Layer 2-45
Internet transport protocols services
TCP service: UDP service:
• reliable transport between • unreliable data transfer
sending and receiving between sending and
process
receiving process
• flow control: sender won’t
overwhelm receiver • does not provide: reliability,
• congestion control: throttle flow control, congestion
sender when network control, timing, throughput
overloaded guarantee, security,
• does not provide: timing, orconnection setup,
minimum throughput
guarantee, security
• connection-oriented: setup Q: why bother? Why is there
required between client and a UDP?
server processes
Application Layer 2-46
App-layer protocol defines
• types of messages exchanged, open protocols:
– e.g., request, response • defined in RFCs
• message syntax: • allows for interoperability
– what fields in messages &
• e.g., HTTP, SMTP
how fields are delineated
• message semantics
proprietary protocols:
– meaning of information in • e.g., Skype
fields
• rules for when and how
processes send & respond to
messages
Application Layer 2-47
Transport service requirements: common apps
application data loss throughput time sensitive
file transfer no loss elastic no
e-mail no loss elastic no
Web documents no loss elastic no
real-time audio/video loss-tolerant audio: 5kbps-1Mbps yes, 100’s
video:10kbps-5Mbps msec
stored audio/video loss-tolerant same as above
interactive games loss-tolerant few kbps up yes, few secs
text messaging no loss elastic yes, 100’s
msec
yes and no
Application Layer 2-48
Internet apps: application, transport protocols
application underlying
application layer protocol transport protocol
e-mail SMTP [RFC 2821] TCP
remote terminal access Telnet [RFC 854] TCP
Web HTTP [RFC 2616] TCP
file transfer FTP [RFC 959] TCP
streaming multimedia HTTP (e.g., YouTube), TCP or UDP
RTP [RFC 1889]
Internet telephony SIP, RTP, proprietary
(e.g., Skype) TCP or UDP
Application Layer 2-49
Securing TCP (SSL) (Secure Sockets Layer)
TCP & UDP SSL is at app layer
• no encryption • Apps use SSL libraries,
• cleartext passwds sent which “talk” to TCP
into socket traverse SSL socket API
Internet in cleartext ❖ cleartext passwds sent
SSL into socket traverse
• provides encrypted TCP Internet encrypted
connection ❖ See Chapter 7
• data integrity
• end-point authentication
Application Layer 2-50
Assignement # 1 (Chapter – 1)
•
- 1st Assignment will be uploaded onthGoogle Classroom after the
lecture in the Stream Section, on 8 September, 2022
- Due Date: Tuesday, 13th September, 2022 (During the lecture)
- Hard copy of the handwritten assignment to be submitted directly
to the Instructor during the lecture.
- Submit the Assignment allotted for your own section only
- Please read all the instructions carefully in the uploaded
Assignment document, follow & submit accordingly
Quiz # 1 (Chapter – 1)
•
- Quiz # 1 for Chapter 1 to be taken in the class on Thursday, 15th September, 2022
during the lecture time
- Quiz to be taken for own section only
No Retake
Be on time