Outline for Network Architecture I. History A. RS-232 i. 25 pin cable ii. 9 pin cable iii. Serial connection a. 1 start bit b. 5-8 data bits c. 1-2 stop bits iv. limited range (50' at 9600 baud) v. modems vi. cheap B. Synchronous i. 25 pin cable ii. 9 pin cable iii. synchronous format a. sync character b. multiple bytes of data c. more expensive d. faster? C. Multi-drop lines D. End to end vs. hop by hop II. Xerox Parc (Palo Alto Research Center) A. Coax Cable for faster speeds B. Resource sharing C. topologies i. Multi-drop ii. point to point iii. bus iv. star D. Ethernet protocol i. developed in mid to late 70's ii. broadband vs. point to point iii. CSMA/CD (Carrier Sense, Multiple Access, w/ Collision Detection) iv. addresses a. 6 byte (48 bit) address b. assigned by manufacturer c. every card has a unique address d. broadcast address ff.ff.ff.ff.ff.ff v. envelope a. 14 byte header 1. 6 byte source address 2. 6 byte destination address 3. 2 byte frame type aa. IP bb. IPX (Novell) cc. IDP (Xerox) dd. ARP ee. Reverse ARP b. data c. 4 byte trailer (optional) III. OSI/ISO model for information exchange. A. Application B. Presentation C. Session D. Transport E. Network F. Data Link G. Physical IV. Internet Protocol (IP) A. 4 byte address (xx.xx.xx.xx) B. Why IP addresses? C. address classes i. Class A (1st bit zero) 1.0.0.0 - 126.0.0.0 (126 subnets of 16m hosts) ii. Class B (1st bit one, second bit zero) 128.0.0.0 - 191.254.0.0 (16,382 subnets of 32k hosts) iii. Class C (1st two bits one, third bit zero) (192.0.0.0 - 223.255.254.0) (2,097,160 subnets of 254 hosts) iv. Class D (1st three bits one, forth bit is zero) Multi-cast for packet video D. Reserved addresses and subnets i. netmask ii. subnet number iii. broadcast address E. IP envelope format i. version (4 bits) ii. header length (4 bits) iii. type of service (1 byte) iv. total lengthof packet (2 bytes) v. id (2 bytes) vi. fragment offset (2 bytes) vii. time to live (1 byte) viii. protocol (1 byte) TCP, UDP ix. checksum (2 bytes) x. source ip address (4 bytes) xi. destination ip address (4 bytes) F. Mapping IP addresses <-> ethernet addresses i. ARP (Address Resolution Protocol) ii. RARP (Reverse Address Resolution Protocol) G. Routing i. localhost loopback (127.0.0.0) ii. routes to this segment iii. routes to other segments iv. gateways or routers V. IP Protocols A. ICMP (Internet Control Message Protocol) i. Echo a ping back ii. Source Quence (slow down) iii. timeout iv. time stamp v. redirect vi. etc. B. UDP (User Datagram Protocol) i. Envelope (8 byte header) a. source port number (2 bytes) b. destination port number (2 bytes) c. packet length (2 bytes) d. checksum (2 bytes) C. TCP (Transport Control Protocol) i. Envelope (20 bytes) a. source port number (2 bytes) b. destination port number (2 bytes) c. sequence number (4 bytes) d. acknowledgement number (4 bytes) e. offset to packet data (1 byte) f. flags (1 byte) g. allocation number (2 bytes) h. checksum (2 bytes) i. urgent pointer (2 bytes) D. services provided by IP, UDP, and TCP i. Service IP UDP TCP Connection-oriented no no yes Message boundaries yes yes no data checksum no opt yes positive ack no no yes timeout and retransmit no no yes duplicate detection no no yes sequencing no no yes flow control no no yes VI. Software, interprocess communications A. Calculator function, char *calc(str) B. Makefiles i. Defines ii. dependancies iii. What to do C. Pipes i. pipe(des) ii. fork() D. Fifos (Named pipes) i. mknod(name,S_IFIFO|PERMS,0) (include sys/types.h, sys/stat.h) E. Sockets i. Socket Connection (src addr,src port,dest addr, dest port) ii. sockfd=socket(AF_INET,SOCK_STREAM or SOCK_DGRAM,0) iii. bind(sockdf,(struct sockaddr *)&addr,sizeof(addr)) iv. connect(sockfd,(struct sockaddr *)&addr,sizeof(addr)) v. listen(sockfd,5) vi. newsockfd=accept(sockfd,(struct sockaddr *)&addr,&clilen) vii. sendto(sockfd,ptr,len,0,addr,addrlen) viii. recvfrom(sockfd,ptr,MAXLEN,0,addr,&addrlen) ix. Who uses what. Function UDP CLI UDP SRV TCP CLI TCP SRV socket x x x x bind x x x connect x listen x accept x sendto x x recvfrom x x x. Data structures aa. struct sockaddr_in addr addr.sin_family = AF_INET addr.sin_addr.s_addr=inet_addr(SERV_HOST_ADDR) addr.sin_addr.s_addr=ntonl(INADDR_ANY) addr.sin_port = htons(SERV_TCP_PORT) VII. getargs.c (gethostbyname) A. Campus network layout B. Routing Issues C. subnets/netmasks VIII. Essential System Administration A. find (p.14) B. Files (inodes, directories, and permissions) C. Processes i. interactive vs daemon ii. Process id/Parent Process id iii. nice/ps D. Startup i. What is involved? (p.61) mount all local file systems start ppp set up routing via routed,in.rdisc start rpc/NIS/YP configure default network interface (netmask & broadcast) start named/add multicast interface/start inetd start automount processes nfs client/statd/lockd/mount nfs file systems start syslog facility start cron start sendmail start nfs server - nfsd/mountd/rarpd/bootparamd start local services ii. Single user mode iii. SYSV run levels (P.64) iv. fsck E. Shutdown i. SYSV shutdown -istate -grace -y ii. states(p.86) iii. BSD shutdown (-h -r) (+minutes/h:m/now) message F. User accounts i. /etc/passwd, /etc/shadow, /etc/group ii. uname:passwd:uid:gid:real name:home:shell iii. choosing passwords G. Security i. Physical security ii. Passwords iii. File permissions/suid/guid iv. list of security files (p.162) IX. TCP/IP Network Administration A. /etc/protocols B. /etc/services C. Name service i. /etc/hosts ii. /etc/domain (p. 60-66) iii. /etc/resolv.conf iv. BIND v. named (p. 167-190) D. Network applications (p. 191-212) i. ftp, telnet ii. rlogin, rsh, rcp iii. nfs E. Trouble shooting (p. 257-300) F. Network Security (p. 301-335)