UDP Programming Basics
Download
Report
Transcript UDP Programming Basics
TCP/IP Networking Review
Covered Subjects:
Packet Switched Network Structure
Issues of PSNs
Ports & IP Numbers
Delivery Services
Domain Name Servers
Client Server Programming
Packet Switched Network
C
A
IP Network
B
D
Packet switched network
◦ means that data is carried in discrete certainsized packets
◦ Analogy: Postal service
Issues
Addressing
1.
◦
Unique address for every host (IPv4 or IPv6
address)
Packet size
2.
◦
Max size = 216-1 = 65535 bytes
Packet forwarding
3.
◦
◦
How to deliver the packet to the
destination?
Simply give the packet to the default router
Analogy
From: Bob
To: Alice
I will write home everyday.
Love.
Bob
Is this how you send your letters to your
friends?
What is missing on the address parts?
◦ The names of the sender & receiver.
◦ It is the people (applications) that
communicate.
Ports & IPs
Alice
Bob
IP Network
A
From: Bob @ A
To: Alice @ B
Port #
IP Address
B
What is next?
How do you want the packet delivered?
Do you want the ACK of delivery?
◦ reliable delivery or not
Delivery services:
1. Best effort (unreliable)
2. Reliable
UDP
TCP
UDP
TCP
: connectionless, unreliable, unordered, datagram services
: connection-oriented, reliable, ordered, byte-stream
IP stack & interaction
ports
sockets
Socket Layer
UDP
TCP
(32-bit) (128-bit)
IPv4
IPv6
Web Server
Browser
A
IP Network
B
designated port
Domain Name Server
How do you identify the server?
www.anadolu.edu.tr
DNS resolver
IP address
What about port #?
◦ designated port 80 – web server
port 21 – FTP servers
port 23 for Telnet ….
Next question
Who initiates a transaction?
◦ Browser -- called the client
Client is the active entity that initiates the
transaction/contact
Server is the passive entity that waits for
requests from clients & sends replies in
response.
This
is why we call this the «client & server»
programming.