1. Computer
Networking: A
Top Down
Approach
6th edition
Jim Kurose, Keith Ross
Addison-Wesley
March 2012
Dr Nauman Mazhar
Faculty of Information Technology (FIT)
University of Central Punjab (UCP)
Computer Communications
& Networks
SENS-3523
• Introduction; Edge, Access, Core N/W
Week: 1
2. Instructor
DR NAUMAN MAZHAR
Associate Professor, Faculty of IT
PhD (Computer Engineering)
Computer Networks & Security
CASE, Islamabad, research element in Michigan State University, USA
MS (Computer Engineering)
Computer Networks & Security
IOWA State University, USA
BE (Avionics Engineering)
College of Aeronautical Engg (CAE), PAF Academy Risalpur (NED Univ)
nau.maz@ucp.edu.pk
2
3. Course Intro
• Basic course in Computer Networking
• Provides overview of…
– What are computer networks
– How do they operate
– How are they designed
• Adopts TOP DOWN approach…
– What services distributed applications require from N/Ws
– What N/W services & how they are provided to support operation of
remote applications – layered approach
– Relevant networking protocols/standards/algorithms, both in wired &
wireless domains
3
Computer Network ??
allow remote, distributed
applications to
communicate & provide
variety of services
4. • Computer Networks & the Internet
– Nuts & Bolts description
– Services description
– Network Edge & Core
– Delay, Loss & Throughput in packet switched networks
– Network architectures (TCP/IP, OSI)
• Application Layer
– Network applications, principles/architectures
– Services required by Apps, & made available by Networks
– Application layer protocols
(Web/HTTP, DNS, FTP, SMTP, POP3)
– Apps development; Socket Programming (TCP & UDP)
Course Contents
4
5. • Transport Layer
– Connection less, unreliable transport – UDP
– Reliable Data Transfer (Go-Back-N, Selective Repeat ARQ)
– Connection oriented transport – TCP
– TCP Connection management, Flow control, Congestion Control
• Network Layer
– Network service model – Datagram & VC networks
– Forwarding & routing, What’s inside a router
– IPv4 protocol, Addressing, Subnetting, CIDR
– DHCP, NAT, ICMP, IPv6 protocol
– Routing algorithms – LS/DV routing
Course Contents
5
6. • Link Layer
– Link layer functions
– Multiple access protocols
– Link layer addressing, ARP
– Link layer Technologies…
• Ethernet – IEEE 802.3 standard
• WiFi – IEEE 802.11 standard
Course Contents
6
8. Books Recommended
Text:
Computer Networking: A Top-Down Approach (6th Ed)
by James F. Kurose & Keith W. Ross
Unix Network Programming – Vol I
by W Richards Stevens
Ref:
Computer Networking: A Systems Approach (5th Ed)
by Larry L. Peterson & Bruce S. Davie
8
9. Course Methodology
Lectures
• 16 power point lectures
• Study relevant sections of Text/Ref books
Assignments
• Assignment done individually or in groups
• To be submitted exactly when due
• 5% marks deduction per day for being late
• After one week – Not Accepted
Exam Pattern
• Exams to include complete material in covered chapters
• MCQs, short answers, problems, design questions
9
10. Grading Policy
Quizzes ………. 04 15%
Assignments ………. 04 15%
Class participation ..….…. 05%
Mid-exam ..….…. 25%
Final-exam .……… 40%
Distribution is tentative and flexible
10
11. • Your work in this class must be your own
• If students are found to have:
– collaborated excessively, or
– copied/shared answers
• For the first infraction…
– all involved, at a min, will receive grades of 0
• Further infractions…
– will result in failure in course
Academic Honesty
11
12. Office Hours
12
Office : Room 11, C-Block
Office Hours: ???
Attendance Policy
Strictly in accordance with the Univ policy…
14. Chapter 1: roadmap
1.1 what is the Internet?
1.2 network edge
end systems (hosts), access networks, links
1.3 network core
packet switching, circuit switching, network structure
1.4 performance
delay, loss, thruput in networks
1.5 protocol layers, service models
1.6 networks under attack: security
1.7 history
14
15. What is the Internet: “Nuts & Bolts” view
Computing devices:
• hosts & end systems
• run network apps
• generate/use data
Communication links:
• copper, fiber,
radio, satellite
• data rate & distance
Packet switches:
forward packets
(chunks of data)
switches & routers
wired
links
wireless
links
router
smartphone
PC
server
wireless
laptop
15
• What basic components make
up the Internet…
16. • Internet: “network of networks”
– hierarchical structure
– interconnected ISPs
(lower tier ISPs, upper tier ISPs, …)
– home N/Ws plug into ISP N/Ws
• Networking “protocols”
– run at end systems & switches
– control sending/receiving of msgs
– HTTP, DNS, TCP, IP, Skype
• Internet standards
– IETF : Internet Engineering Task Force
– RFC : Request for comments
16
What’s the Internet: “Nuts & Bolts” view
17. “Fun” Internet appliances
IP picture frame
http://www.ceiva.com/
Web-enabled toaster +
weather forecaster
Internet phones
Internet
refrigerator
Slingbox: watch,
control cable TV remotely
Tweet-a-watt:
monitor energy use
17
18. What’s the Internet: Services view
• What services are provided to Apps
by Internet…
– Apps: Web, Email, VoIP, E-commerce,
Internet TV/radio, audio/video on demand,
video conf, online games, social nets
– Distributed Apps: involve multiple end
systems that exchange data remotely
– Require different Types of Services:
reliable or unreliable data delivery,
thruput/delay needs, security
– How does N/W provide services to
applications…???
18
19. What’s the Internet: Services view
• End Systems provide an interface
to apps
– Network API
“library functions” that allow
“process” on source end system to:
• “connect” to Internet
• “send/recv” data
– Specifies syntax
• how an appl asks Internet to
“send/receive data”
(provides options for various
types of services …)
19
20. An important buzzword in computer networking… “Protocol“
“pre-defined set of rules”
Analogy… Human protocol & Computer Network protocol…
What’s a protocol?
Hi
Hi
Got the
time?
2 pm
TCP connection
response
Get http://www.awl.com/kurose-ross
<file>
time
TCP connection
request
20
21. Why Network protocols?
• machines need coordination to interact with other machines
• require some protocol to operate in coordination
Network protocols define…
format/order of msgs among network entities,
& actions taken on msg Tx/Rx
21
all communications activity in Internet governed by protocols…
specific msgs sent
specific actions taken when msgs sent/recvd, or other events
occur
22. Network Structure
network edge:
end systems
hosts, servers, apps
access networks
N/Ws connecting end
systems to edge routers
wired/wireless comm
links
network core:
interconnection of routers
route pkts from src to dst host
form network of networks
22
23. The network edge
End systems (hosts):
host (run) appl programs
e.g, Web, email
Client/server model:
hosts act as clients or servers
server – always ON powerful machine
client – request/receive service
e.g, web browser/server,
email client/server
Peer-peer model:
all hosts equal
minimal (or no) use of dedicated servers
e.g, Skype, BitTorrent, Gnutella
23
24. Access networks
Networks to connect end
systems to edge router
• Several types of access networks
used in various settings…
– home access
– enterprise access
– wireless access
points to note…
• range & data rate of access
network ?
• access is shared or dedicated ?
24
25. Home Access
How do homes connect to
Internet
• Digital Subscriber Line (DSL)
• Cable Internet access
• Fiber to the Home (FTTH)
• Dial up modem
Two most prevalent ones are
DSL & Cable
25
26. Enterprise access networks (Ethernet)
26
Local Area Network (LAN) – connects end systems to edge router
Ethernet : most prevalent access N/W technology
twisted pair copper wire & LAN switches
dedicated link between host and switch
typically 100 Mbps to end systems; 1 - 10 Gbps to servers
27. Wireless access networks
• Shared wireless access network connects end system to edge router
– via “access point”or “base station”
Wireless LANs:
within building (100 m)
802.11b/g (WiFi): 11, 54 Mbps
transmission rate
Wide-area Wireless access:
by cellular N/W operator
range 10’s of kms
data rate 1 - 10 Mbps
3G, 4G, LTE,….
WiMAX
to Internet
to Internet 27
28. • Mesh of interconnected routers
• Fundamental question…
“how is data transferred thru N/W”
– Circuit switching
̶ resources along the path reserved
for Tx duration
e.g, telephone network
̶ guaranteed service
– Packet switching
̶ N/W resources used on demand
e.g, Internet
̶ best effort service
The network core
28
30. Network Architecture
• Network communications - a complex task
• To deal with this complexity… SIMPLIFY
– comm task divided into modules
– modules arranged in layers
– each layer performs a subset of comm function
– Forms a Network Architecture
• multiple layers
• each layer has one/more Protocols
• protocols perform specific comm tasks
• provide/obtain services to/from higher/lower layer
30
31. Example of a layered
network system
Network Architecture
Network Architecture
A structured set of protocols to implement the
communications function
application
transport
network
link
physical
31
32. Internet protocol stack
• Application: support applications (network API)
FTP, SMTP, HTTP, DNS, DHCP
• Transport: process-process data transfer (ports)
TCP (reliable), UDP (unreliable)
• Network: host-host data transfer, global
addressing (IP addr), routing of pkts from src to
dest
IPv4, IPv6
• Link: hop-hop data transfer, between
neighboring network elements
Ethernet, WiFi (802.11), 3G/4G, PPP
• Physical: bits “on the wire”
application
transport
network
link
physical
32
33. TCP/IP Model
• Some of the protocols & networks in TCP/IP protocol stack…
33
Ethernet WiFi PPP
3G/4G
HTTP FTP SMTP DNS
34. Encapsulation
34
Data generated by Appl layer
When being sent, each layer
appends its header
When being received, each
layer removes its header
Principle of Encapsulation &
Decapsulation
35. Why Layered Architecture
• Network Architecture - layered architecture
– provides modularity
• changes in one layer do not require changes in other layers
• simplifies system maintenance & upgradation
– facilitates process of network evolution
• allows to change/improve underlying technologies, with
increase in application demands
35
37. Some network apps
• e-mail
• web surfing
• search engine
• P2P file sharing
• text messaging
• social networking
• remote login
• streaming stored video
(YouTube, Netflix)
• IP radio, TV
• multi-user N/W games
• voice over IP
(Skype, viber)
• real-time video
conferencing
• …..
37
How these appls are created…
38. 38
Creating network apps
Write appl programs to run only on
end systems
appl comm over N/W
web browser comm with server
No need to write software for
network-core devices…
network-core devices function at
lower layers
confining appls to end systems
allows rapid appl development &
deployment
application
transport
network
data link
physical
application
transport
network
data link
physical
application
transport
network
data link
physical
40. Client-server architecture
Servers
• always-on host
• permanent addr (IP & port)
• rely on fixed infra-structure
• data centers for scaling
Clients
• request services from servers
• intermittent host connections
• dynamic addr (IP & port)
• no direct comm with each other
client/server
40
41. P2P architecture
• NO always-on server
– arbitrary end systems comm directly
• peers request services from other
peers, & also provide services
• Self Scalability
– new peers bring new service demands
– also add new service capacity
• Complex Management
– peers connect intermittently
– change IP addrs
• min, or no reliance, on infra-structure
41
peer-peer
42. Architectural Challenges
Client Server
• Infra-structure intensive
• Cost of server hardware, software & access network B/W
• System management needs/costs
• May become a bottleneck
P2P
• Not ISP friendly; require high upload B/W
• Security issues
• Incentives; users need to volunteer storage, bandwidth &
computation resource
42
43. How do Appls comm
• Appls within same host
– processes usually comm
using IPC
(Inter Process Comm)
– Pipes, FIFOs, shared
memory
43
Applications are processes running on hosts…
Appls in distant hosts
processes comm by
exchanging messages
Sockets, RPC
44. • Remote processes comm thru sockets…
Socket : “software interface between process & N/W”
• Process sends/receives msgs to/from its socket
– process reads/writes the socket to receive/send msgs
44
Sockets
45. Process Address
• to receive msgs, process must
have identifier
• host device has unique
IP address (32 bits)
but many processes may run
on same host
need another level of
identifier – Port No (16 bits)
• identifier includes both
IP address & port number
associated with a process
on a host…
– Socket address
IP addr + Port No
45
to send HTTP msg to web server gaia.cs.umass.edu…
IP address: 128.119.245.12 port number: 80
46. Socket Programming
• Allows network applications to communicate across an Internet
• Socket API mainly provides
Transport layer service
interface
• Stream-sockets for TCP
• Datagram-sockets for UDP
• Based on client/server
architecture
Socket Interface
TCP UDP
IP
Network Access
46
47. Client/Server functions
• Client / Server may run on same or different hosts
• Client makes Request…
– sends message to server to perform a task
• Server Responds…
– performs task & sends back reply
Client
process
Server
process
1. Client sends request
2. Server
handles
request
3. Server sends response
4. Client
handles
response
Resource
47
48. Servers
• Servers : long-running application processes (daemons)
– typically created at boot-time by OS
– run continuously in background
– web server, or mail server
• Server waits for requests on a well-known port associated with
a particular service
– Port 7: echo server
– Port 23: telnet server
– Port 25: mail server
– Port 53: DNS server
– Port 80: HTTP server
/etc/services
provides list of available
services
(Linux machine)
48
49. Clients
• Client – appl launched to access some service, mostly on remote
system
– web browser, ftp client, telnet client, ssh client
• Client does not need well known port
– usually assigned ephemeral port by kernel
– can also be selected by application
Server - need not know client location
Client - needs to know server location
(port + IP address)
49
50. Socket
• Socket is an endpoint of bidirectional comm…
– identified by socket descriptor
• Clients & Servers comm with each other thru sockets
– open a socket
– write data to socket
– read data from socket
App
socket
3 2 1
Dest.
50
51. Socket Address
• The pair IP Address + Port -– makes up a “socket-address”
Server
Client
Client socket address
128.2.194.242:3479
Server socket address
208.216.181.15:53
Client IP address
128.2.194.242
Server IP address
208.216.181.15
3479 is an
ephemeral port
allocated by
kernel (unix)
53 is a well-known
port associated with
DNS servers
51
52. TCP & UDP Ports
• TCP and UDP port numbers ranges:
– values 0 – 216 (65,536 ports)
– Internet Assigned Numbers Authority (IANA)
• Well Known Ports (0 - 1023)
– used by system processes for well known services
– HTTP: 80, E-mail: 25, DNS: 53
• Registered Ports (1024 - 49151)
– used by vendors for common applications
– Web Proxy: 8080, IPSec: 1293, Kaaza: 1214
• Dynamic or Ephemeral Ports (49152 - 65535)
– used by clients
– automatically allocated by kernel on temporary basis
52
53. Summary
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
53