




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This lecture was delivered by Prof. Akanksha Vrajakishore at Ankit Institute of Technology and Science for Network and System Administration course. It includes: Network, Programming, TCP/IP, UNIX, Coding, Standard, Applications, Client, Servers, Security, Sockets
Typology: Slides
Uploaded on 07/18/2012
1 / 167
This page cannot be seen from the preview
Don't miss anything!





























































































Network Programming with TCP/IP
Network Programming with TCP/IP
UNIX Network Programming with TCP/IP
Short Course Notes
Alan Dix © 1996
http://www.hiraeth.com/alan/tutorials
UNIX
Network Programming with TCP/IP
Alan Dix http://www.hcibook.com/alan
Session 1 Internet Basics Session 2 First Code Session 3 Standard Applications
Session 4 Building Clients Session 5 Servers I Session 6 Servers II Session 7 Security
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 1
Network Programming with TCP/IP
Network Programming
Internet Basics
UNIX
Network Programming with TCP/IP
Alan Dix http://www.hcibook.com/alan
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 1
a collection of
a particular internet which
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 3
Characteristics of the Internet
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 4
Protocols – the Language of the Internet
electrical signals
low-level networks (e.g. ethernet)
IP layer (end-to-end)
TCP/UDP layer
application protocols (e.g. FTP, telnet, http) application user interfaces (e.g. Fetch, mosaic)
ICMP (control and routing)
Physical
Link
Transport
Network
Session, Presentation, Application
routers
end-points
Standardisation:
RFCs also include (defined but not required):
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 6
Addressing
J. C. T. Jennings, Linbury Court School, Dunhambury, Sussex, England, Europe, Eastern Hemisphere, Earth, near Moon, Solar System, Space, near More Space†
Without addresses can only broadcast
Four types of address:
¬ location independent e.g. personal names physical location e.g. letter addresses ® logical location e.g. organisational hierarchy ¯ route based e.g. old email addresses
Two kinds of Internet address:
IP address – type (sort of) e.g. 161.12.188. domain name – type ® e.g. zeus.hud.ac.uk
† (^) extract from Jennings Goes to School, Anthony Buckeridge, Collins, 1950.
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 7
Domain names
zeus.hud.ac.uk uk – United Kingdom ac – academic hud – huddersfield zeus – local machine N.B. USA is implicit – cs.washington.edu
from name to IP address
gethostbyname – name → IP address gethostbyaddr – IP address → name
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 9
Common applications
h In each case protocols are defined
h User interfaces depend on platform (where relevant)
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 10
Network communications
Communication can be:
h like letters
h like telephone
N.B. both need an address
or, publicly known addresses
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 12
Network communications – 2
Other issues:
Do all messages arrive? Do they arrive in the right order?
effects responsiveness hides potential deadlock
sent: write 1 (len=26): “abcde....vwxyz” write 2 (len=10): “0123456789” received: read 1 (len=20): “abcde....qrst” read 2 (len=16): “uvwxyz012...89”
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 13
TCP & UDP
(on UNIX platforms)
used in: FTP, telnet, http, SMTP
used in: NFS, TFTP
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 15
Port numbers
UNIX TCP/IP^ Short Course Notes Alan Dix © 1996 16