21-04-2012, 03:44 PM
Programmer view of the Internet
prasanth.ppt (Size: 161.5 KB / Downloads: 40)
1. Hosts are mapped to a set of 32-bit IP addresses.
128.2.203.179
2. The set of IP addresses is mapped to a set of identifiers called Internet domain names.
128.2.203.179 is mapped to
3. A process on one Internet host can communicate with a process on another Internet host over a connection.
IP Addresses
32-bit IP addresses are stored in an IP address struct
IP addresses are always stored in memory in network byte order (big-endian byte order)
True in general for any integer transferred in a packet header from one machine to another.
E.g., the port number used to identify an Internet connection.
Domain Naming System (DNS)
The Internet maintains a mapping between IP addresses and domain names in a huge worldwide distributed database called DNS.
Conceptually, programmers can view the DNS database as a collection of millions of host entry structures:
Sockets
What is a socket?
To the kernel, a socket is an endpoint of communication.
To an application, a socket is a file descriptor that lets the application read/write from/to the network.
Remember: All Unix I/O devices, including networks, are modeled as files.