lecture28 - CIS 450 Computer Architecture and Organization...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 450 – Computer Architecture and Organization Lecture 28: Network Programming Mitch Neilsen (neilsen@ksu.edu ) 219D Nichols Hall
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Topics ± Peeking at Internet traffic ± Programmer’s view of the Internet ± Berkeley Sockets interface ± Writing clients and servers ± Understanding protocols
Background image of page 2
Packet Sniffing Program That Records Network Traffic Visible at Node ± Promiscuous Mode z Record traffic that does not have this host as source or destination z Enables users to acquire information that is not intended to be seen by them z Useful for debugging network protocols – limit access to protocol being debugged and only for information needed ± Examples z Tcpdump z Wireshark (Ethereal) z Etc.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
A Client-Server Transaction Client process Server process 1. Client sends request 2. Server handles request 3. Server sends response 4. Client handles response Resource Most network applications are based on the client- server model: ± A server process and one or more client processes ± Server manages some resource . ± Server provides service by manipulating resource for clients. Note: clients and servers are processes running on hosts (can be the same or different hosts).
Background image of page 4
A Programmer’s View of the Internet 1. Hosts are mapped to a set of 32-bit IP addresses . ± 129.130.10.26 2. The set of IP addresses is mapped to a set of identifiers called Internet domain names . ± 129.130.10.26 is mapped to cislinux.cis.ksu.edu ± 129.130.10.39 is mapped to www.cis.ksu.edu which has a canonical name of viper.cis.ksu.edu 3. A process on one Internet host can communicate with a process on another Internet host over a connection .
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
1. 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. z E.g., the port number used to identify an Internet connection. /* Internet address structure */ struct in_addr { unsigned int s_addr; /* network byte order (big-endian) */ }; Handy network byte-order conversion functions: htonl: convert long int from host to network byte order. htons: convert short int from host to network byte order. ntohl: convert long int from network to host byte order. ntohs: convert short int from network to host byte order.
Background image of page 6
2. 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 : Functions for retrieving host entries from DNS: ± gethostbyname : query key is a DNS domain name. ± gethostbyaddr:
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 8
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 41

lecture28 - CIS 450 Computer Architecture and Organization...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online