Professional Documents
Culture Documents
CODE : 7SR3
SUBJECT: COMPUTER NETWORK & INTERNET (CNI)
SECTION-A
Unit-I: Introduction, Brief history of the computer networks & Internet, Layered
architecture, Internet Protocol stack, Network entities & Layers, Application Layer:
Principal of protocols HTTP, FTP, SMTP and DNS protocols.
Unit-II: Transport Layer: Services & Principals, Multiplexing & Demultiplexing
applications, UDP, Principals of reliable data transfer, TCP details, Principals of
Congestion control, TCP congestion control
Unit-III: N/W layer: Introduction, N/W Service model, Routing Principals, Hierarchical
routing, Internet Protcol IP, ICMP details, Routing in internet, Router internals, Ipv6
SECTION-B
Unit-IV: Link Layer: Introduction, Services, Error detection & correction techniques,
Multiple Access Protocols, LAN address & ARP, CSMA/CD, PPP details, Multimedia
networking and RTSP protocol, RTP details.
Unit-V: N/W security: Basic issues, principals of cryptograghy, Authenticaion &
authenticaion protocol versions, Integrity: Digital signatures, message digests, hash
function algorithms, Key distribution & certification, Secure e-mail, e-commerce: SSL
& SET, IPSec details.
Unit-VI: Network Management: Basic principals, Infrastructure 4 n/w management,
The internet netowrk management framework: SMI, MIB, SNMP details, Security &
administration, ASN.1, Firewalls: Packet filtering and application Gateways
Computer Network & Internet
Text Book:
James F Kurose, KW Ross - Computer Networking, LPE
Reference:
D E Comer: Computer Networks & Internet, Addison-Wesley
A S Tananbaum: Computer Networks, TMH
W Stallings: Data & Communication, 6/e LPE
Unit-I: Introduction, Brief history of the computer networks & Internet, Layered
architecture, Internet Protocol stack, Network entities & Layers, Application Layer:
Principal of protocols HTTP, FTP, SMTP and DNS protocols.
7SR3
CNI
U-I
WHAT IS CNI? Computer Network & Internet
• CNI Objective: Have some fun, and learn about how modern
networks work, with emphasis on the practical applications that
most of you see and use every day.
• NOT a study of the OSI model, or older technologies and protocols.
• NOT a certification course for Network Specialists.
• NOT a study of network hardware or data communications equipment
SUBJECT WEBSITE
For assignments, notes, notices, test results, syllabus, schedules, etc…
http://www.ssgmce.ac.in/~cmmankar/
Or
http://www.ssgmce.ac.in/cmmankar/
WHAT IS CNI?
http://www.ssgmce.ac.in/~cmmankar/
WHAT IS CNI? What’s this all about??
application
transport
network
• What really happens when data link
physical
I………? request
• How does my email get
from point a to point b?
• What do all these network
“buzzwords” mean to me? reply
• Why does my browser application
transport
http://www.ssgmce.ac.in/~cmmankar/
Computer Network & Internet
Communication Link
• protocols: control sending,
receiving of messages
– e.g., TCP, IP, HTTP,
FTP, PPP
• Internet: “network of
networks”
– loosely hierarchical
– public Internet versus
private intranet
• Internet standards
– RFC: Request for
comments
– IETF: Internet
Engineering Task
Force
7SR3 Network
CNI
U-I http://www.ssgmce.ac.in/~cmmankar/
Computer Network & Internet
• millions of connected
computing devices: hosts,
end-systems router workstation
– pc’s workstations, servers
server
– PDA’s phones, etc… mobile
local ISP
running network apps
Hi TCP conx’n
request
T T
Hi TCP conx’n
I I
response
What’s time? M http://www.ssgmce.org M
E E
2:00 <file>
http://www.ssgmce.ac.in/~cmmankar/
WHAT IS PROTOCOL ?
network protocols
Protocols define format &
• machines rather than order of messages sent and
humans received among network
• all communication activity entities, and actions taken on
in Internet governed by message transmission and
protocols receipt.
• roughly hierarchical
• national/international backbone providers (NBPs)
– e.g. Genuity/Level 3, Sprint, AT&T, IBM, UUNet, MCI
– interconnect (peer) with each other privately,
or
at public Network Access Point (NAPs)
• regional ISPs
– connect into NBPs
server:
– always-on host
– permanent IP address
– server farms for scaling
clients:
– communicate with server
– may be intermittently connected
– may have dynamic IP addresses
– do not communicate directly with each other
http://www.ssgmce.ac.in/~cmmankar/
PROCESS COMMUNICATING
host or host or
server server
Process: program running
within a host. controlled by
app developer
process process
• within same host, two socket socket
processes communicate using TCP with TCP with
inter-process communication buffers, Internet buffers,
variables variables
(defined by OS).
IPC
controlled
by OS
• processes in different hosts
communicate by exchanging Client process: process that
messages initiates communication
Server process: process that
waits to be contacted
http://www.ssgmce.ac.in/~cmmankar/
Sockets : Client-Server Architecture
• process sends/receives
messages to/from its socket
host or host or
• socket analogous to door server server
– sending process shoves
controlled by
message out door app developer
process process
– sending process relies on
socket socket
transport infrastructure on
TCP with TCP with
other side of door which buffers, Internet buffers,
brings message to socket variables variables
at receiving process
controlled
by OS
ADDRESSING PROCESSES
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
HTTP overview
HTTP: hypertext transfer protocol HT
TP
• r
equ
Web’s application layer protocol PC running HT est
TP
• client/server model Explorer res
pon
– client: browser that requests, se
receives, “displays” Web
objects e st
u
– server: Web server sends P r eq se Server
T o n
objects in response to requests HT r es
p running
T P Apache Web
• HTTP 1.0: RFC 1945 HT
server
• HTTP 1.1: RFC 2068
Mac running
Navigator
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
HTTP connections
Nonpersistent HTTP Persistent HTTP
• At most one object is • Multiple objects can
sent over a TCP be sent over single
connection. TCP connection
• HTTP/1.0 uses between client and
nonpersistent HTTP server.
• HTTP/1.1 uses
persistent connections
in default mode
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Persistent HTTP
Nonpersistent HTTP issues: Persistent without pipelining:
• requires 2 RTTs per object • client issues new request only
• OS must work and allocate host when previous response has
resources for each TCP been received
connection • one RTT for each referenced
• but browsers often open parallel object
TCP connections to fetch
referenced objects Persistent with pipelining:
Persistent HTTP • default in HTTP/1.1
• server leaves connection open • client sends requests as soon as
after sending response it encounters a referenced
• subsequent HTTP messages object
between same client/server are • as little as one RTT for all the
sent over connection referenced objects
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Carriage return,
line feed (extra carriage return, line feed)
indicates end
of message
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
www.somesite.com/animalsearch?monkeys&banana
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Method types
HTTP/1.0 HTTP/1.1
• GET • GET, POST, HEAD
• POST • PUT
• HEAD – uploads file in entity
– asks server to leave body to path specified
requested object out of in URL field
response • DELETE
– deletes file specified in
the URL field
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Cookie file
usual http request msg
amazon: 1678 cookie: 1678 cookie- ss
ebay: 8734 specific acce
usual http response msg action
ss
one week later:
ce
ac
usual http request msg
Cookie file cookie-
cookie: 1678
amazon: 1678 spectific
ebay: 8734 usual http response msg action
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
institutional
cache
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Consequences
• utilization on LAN = 15%
10 Mbps
• utilization on access link = 15% access link
• Total delay = Internet delay + institutional
access delay + LAN delay network
10 Mbps LAN
= 2 sec + msecs + msecs
• often a costly upgrade
institutional
cache
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Consequence
• 40% requests will be satisfied
almost immediately 1.5 Mbps
• 60% requests satisfied by origin access link
server
institutional
• utilization of access link reduced network
to 60%, resulting in negligible 10 Mbps LAN
delays (say 10 msec)
• total avg delay = Internet delay
+ access delay + LAN delay = .
6*(2.01) secs + milliseconds < institutional
1.4 secs cache
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Conditional GET
• Goal: don’t send object if cache server
cache has up-to-date cached HTTP request msg
version If-modified-since:
object
<date>
• cache: specify date of cached not
copy in HTTP request HTTP response modified
If-modified-since: HTTP/1.0
<date> 304 Not Modified
• server: response contains no
object if cached copy is up- HTTP request msg
to-date: If-modified-since:
<date> object
HTTP/1.0 304 Not
Modified modified
HTTP response
HTTP/1.0 200 OK
<data>
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
outgoing
message queue
Electronic Mail user mailbox
user
agent
Three major components: mail
user
• user agents server
agent
• mail servers
SMTP mail
• simple mail transfer protocol: SMTP
server user
User Agent SMTP agent
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Scenario: Alice sends message to Bob
1) Alice uses UA to compose 4) SMTP client sends Alice’s
message and “to” message over the TCP
bob@someschool.edu connection
2) Alice’s UA sends message to 5) Bob’s mail server places the
her mail server; message placed message in Bob’s mailbox
in message queue 6) Bob invokes his user agent to
3) Client side of SMTP opens TCP read message
connection with Bob’s mail
server
1 mail
mail
server user
user server
2 agent
agent 3 6
4 5
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
• telnet servername 25
• see 220 reply from server
• enter HELO, MAIL FROM, RCPT TO, DATA,
QUIT commands
above lets you send email without using email client
(reader)
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
POP3 protocol S:
C:
+OK POP3 server ready
user bob
authorization phase S: +OK
C: pass hungry
• client commands:
S: +OK user successfully logged on
– user: declare username
– pass: password C: list
S: 1 498
• server responses S: 2 912
– +OK S: .
– -ERR C: retr 1
S: <message 1 contents>
transaction phase, client:
S: .
• list: list message numbers C: dele 1
• retr: retrieve message by C: retr 2
number S: <message 1 contents>
• dele: delete S: .
• quit C: dele 2
C: quit
S: +OK POP3 server signing off
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
sessions
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
DNS
DNS services Why not centralize DNS?
• Hostname to IP address • single point of failure
translation • traffic volume
• Host aliasing • distant centralized database
– Canonical and alias names • maintenance
• Mail server aliasing
• Load distribution doesn’t scale!
– Replicated Web servers: set
of IP addresses for one
canonical name
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Distributed, Hierarchical
Root DNS Servers
Database
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
m WIDE Tokyo
e NASA Mt View, CA
f Internet Software C. Palo Alto,
CA (and 17 other locations)
13 root name
b USC-ISI Marina del Rey, CA
servers
l ICANN Los Angeles, CA
worldwide
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Example
2
• Host at cis.poly.edu 3
TLD DNS server
wants IP address for 4
gaia.cs.umass.edu 5
gaia.cs.umass.edu
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
gaia.cs.umass.edu
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
DNS records
DNS: distributed db storing resource records (RR)
RR format: (name, value, type, ttl)
• Type=A • Type=CNAME
– name is hostname – name is alias name for some
– value is IP address “cannonical” (the real) name
www.ibm.com is really
• Type=NS
servereast.backup2.ibm.com
– name is domain (e.g. foo.com)
– value is cannonical name
– value is IP address of
authoritative name server for • Type=MX
this domain – value is name of mailserver
associated with name
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
msg header
• identification: 16 bit # for
query, reply to query uses
same #
• flags:
– query or reply
– recursion desired
– recursion available
– reply is authoritative
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
RRs in reponse
to query
records for
authoritative servers
additional “helpful”
info that may be used
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Socket programming
Goal: learn how to build client/server application that
communicate using sockets
socket
Socket API
• introduced in BSD4.1 UNIX,
1981 a host-local, application-
• explicitly created, used, released created, OS-controlled
by apps interface (a “door”) into
• client/server paradigm which application process
• two types of transport service via can both send and receive
socket API: messages to/from
– unreliable datagram another application
– reliable, byte stream-oriented process
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
controlled by
controlled by process application
application process
developer
developer socket socket
controlled by TCP with TCP with controlled by
buffers, operating
operating buffers, internet system
system variables variables
host or host or
server server
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Stream ?????
• A stream is a sequence of characters that
flow into or out of a process.
• An input stream is attached to some input
source for the process, eg, keyboard or
socket.
• An output stream is attached to an output
source, eg, monitor or socket.
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
inFromUser
input
stream
sends to server via socket Client
(outToServer stream) Process
process
2) server reads line from socket
3) server converts line to uppercase,
sends back to client
4) client reads, prints modified line
inFromServer
outToServer
output input
stream stream
from socket (inFromServer
stream)
client
clientSocket
TCP
socket TCP
socket
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
write reply to
connectionSocket read reply from
clientSocket
close
connectionSocket close
clientSocket
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
sentence = inFromUser.readLine();
Send line
to server outToServer.writeBytes(sentence + '\n');
clientSocket.close();
}
}
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
class TCPServer {
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
create socket,
port=x, for create socket,
clientSocket =
incoming request: DatagramSocket()
serverSocket =
DatagramSocket()
Create, address (hostid, port=x,
send datagram request
using clientSocket
read request from
serverSocket
write reply to
serverSocket
specifying client read reply from
host address, clientSocket
port number close
clientSocket
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
inFromUser
input
stream
Client
Process
Input: receives
process
packet (TCP
Output: sends received “byte
packet (TCP sent stream”)
receivePacket
sendPacket
“byte stream”) UDP UDP
packet packet
client
clientSocket UDP
socket UDP
socket
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
class UDPClient {
public static void main(String args[]) throws Exception
{
Create
input stream BufferedReader inFromUser =
new BufferedReader(new InputStreamReader(System.in));
Create
client socket DatagramSocket clientSocket = new DatagramSocket();
Translate
InetAddress IPAddress = InetAddress.getByName("hostname");
hostname to IP
address using DNS byte[] sendData = new byte[1024];
byte[] receiveData = new byte[1024];
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
class UDPServer {
public static void main(String args[]) throws Exception
Create {
datagram socket
DatagramSocket serverSocket = new DatagramSocket(9876);
at port 9876
byte[] receiveData = new byte[1024];
byte[] sendData = new byte[1024];
while(true)
{
Create space for
DatagramPacket receivePacket =
received datagram
new DatagramPacket(receiveData, receiveData.length);
Receive serverSocket.receive(receivePacket);
datagram
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
sendData = capitalizedSentence.getBytes();
Create datagram
DatagramPacket sendPacket =
to send to client new DatagramPacket(sendData, sendData.length, IPAddress,
port);
Write out
datagram serverSocket.send(sendPacket);
to socket }
}
} End of while loop,
loop back and wait for
another datagram
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
SUMMARY
• specific protocols:
• Application architectures – HTTP
– client-server – FTP
– P2P – SMTP, POP, IMAP
– hybrid – DNS
• application service requirements:
• socket programming
– reliability, bandwidth, delay
• Internet transport service model
– connection-oriented, reliable: TCP
– unreliable, datagrams: UDP
http://www.ssgmce.ac.in/~cmmankar/
Client-Server Architecture
Summary
http://www.ssgmce.ac.in/~cmmankar/