Download Overview of Socket Programming

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Point-to-Point Protocol over Ethernet wikipedia , lookup

Server Message Block wikipedia , lookup

Dynamic Host Configuration Protocol wikipedia , lookup

Net bias wikipedia , lookup

Wake-on-LAN wikipedia , lookup

Lag wikipedia , lookup

Remote Desktop Services wikipedia , lookup

Deep packet inspection wikipedia , lookup

AppleTalk wikipedia , lookup

Zero-configuration networking wikipedia , lookup

Cracking of wireless networks wikipedia , lookup

TCP congestion control wikipedia , lookup

Recursive InterNetwork Architecture (RINA) wikipedia , lookup

Internet protocol suite wikipedia , lookup

Transcript
1
Lecture 1
Overview of Socket Programming
Erick Pranata
© Sekolah Tinggi Teknik Surabaya
» Hosts and Routers
» Communication Channel
» Packets
» Protocol
» TCP/IP as Protocol Suite
˃ Internet Protocol (IP)
˃ Transmission Control Protocol (TCP)
˃ User Datagram Protocol (UDP)
2
© Sekolah Tinggi Teknik Surabaya
David Makofske, Michael J. Donahoo, Kenneth L. Calvert,
TCP/IP Sockets in C#: Practical Guide for Programmers, Morgan Kaufmann, 2004, p. 3
3
© Sekolah Tinggi Teknik Surabaya
Application • GUI being Displayed
Transport
• TCP
• UDP
Internet
• Internet Protocol
• Datagram Service
Network
Interface
• Routing
© Sekolah Tinggi Teknik Surabaya
4
» Datagram Service
˃ Each IP packet has destination address
˃ Best-effort Protocol
+ May lose
+ Needs to be reordered
+ Duplicate packets
» TCP and UDP utilize Port Numbers
» TCP and UDP are called end-to-end
transport
» TCP provides error recovery on host-tohost channel
˃ UDP doesn’t
© Sekolah Tinggi Teknik Surabaya
5
» Internet Address (IP)
˃ 32-bit (e.g. 10.1.2.3, dotted-quad
notation): IPv4
˃ 128-bit: IPv6
» Port Number (TCP and UDP)
˃ 16-bit unsigned binary (1 to 65.535)
6
© Sekolah Tinggi Teknik Surabaya
» Example: host.example.com
» IP deals with numerical addresses, not
names
» TCP/IP doesn’t need names
˃ It requires extra work to resolve name into
address
» Advantages:
˃ Easier to remember
˃ Insulates users from IP address changes
» Name-resolution Service
˃ DNS
˃ Local Configuration Database
© Sekolah Tinggi Teknik Surabaya
7
» Client program initiates communication
» Server program
˃ Waits passively
˃ Responds to clients that contact it
» Example:
˃ Database Application
˃ Web Application
˃ Directory Services
8
© Sekolah Tinggi Teknik Surabaya
» Client needs to know server’s address
and port, not vice versa
» Server’s address: through name or IP
Address
» Server’s port number
˃ Convention (Internet Assigned Number
Authority)
+ 21: FTP
+ 80: HTTP
˃ Custom port number
© Sekolah Tinggi Teknik Surabaya
9
» An abstraction which allow an
application to send and receive data
» Different types of socket correspond
with different types of protocol suites
» TCP/IP Sockets:
˃ Stream Sockets (TCP)
˃ Datagram Sockets (UDP)
10
© Sekolah Tinggi Teknik Surabaya
David Makofske, Michael J. Donahoo, Kenneth L. Calvert,
TCP/IP Sockets in C#: Practical Guide for Programmers, Morgan Kaufmann, 2004, p. 7
11
© Sekolah Tinggi Teknik Surabaya
» David Makofske, Michael J. Donahoo,
Kenneth L. Calvert, TCP/IP Sockets in C#:
Practical Guide for Programmers,
Morgan Kaufmann, 2004
12
© Sekolah Tinggi Teknik Surabaya