chapter 9 networking graham glass and king ables, unix for programmers and users, third edition,...

14
Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users , Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman Converted to presentation and updated by Michael Weeks

Upload: ethan-hart

Post on 01-Jan-2016

225 views

Category:

Documents


5 download

TRANSCRIPT

Page 1: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Chapter 9Networking

Graham Glass and King Ables, UNIX for Programmers and Users,

Third Edition, Pearson Prentice Hall, 2003.

Original Notes by Raj SunderramanConverted to presentation and updated by

Michael Weeks

Page 2: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Ethernet

Ethernet: hardware standard allows two or more computers to be connected

defines cabling, signaling, and behaviors

Each computer contains a Ethernet card, a special piece of hardware that has a unique Ethernet address

Every Ethernet card is connected to the same piece of wire

Page 3: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Ethernet

When a computer wishes to send a message to another computer it broadcasts the message along with a destination address;

Only the Ethernet card whose address matches the destination address accepts the message.

When a collision occurs (two messages sent at the same time), both computers wait a random period of time and re-broadcast the message.

Page 4: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Network Devices

Bridges: Special hardware connecting two segments of Ethernet cable (serial connection between two groups of computers)

Routers: hooks together two or more networks and automatically routes messages to the proper network.

Gateways: High capacity routers which connect Local Area Networks. These are placed geographically apart. (WAN)

Page 5: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Internet

Internet: Collection of LANs and WANs working together. packet switching: messages are split into small

packets, each of which is routed independently (switched) through the network.

specially encoded information in packets allow them to be recombined at the destination.

Page 6: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Internet Addresses

Internet Protocol (IP version 4) addressing is a hardware independent labeling scheme 32 bit address made up of 4 bytes

each part has a value between 0 and 255

IP-version 6 scheme: 128 bit addresses numerical addresses are not convenient; so names

are used

/etc/hosts file contains names-numbers for all local host names

Page 7: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Routing

Done statically using information in /etc/route file or

Dynamically using /etc/routed and /etc/gated programs which constantly update the routing tables and share this with nearby hosts

Page 8: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Remote Shells

If a user has accounts on several machines in the network with the same userid, they are able to execute commands on other machines without providing a password.

For example, from tinman.cs.gsu.edu:

% rsh zeus who

If you have a file called .rhosts in your home directory with a list of host names (full names) then this is possible (machine equivalence)

Page 9: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Network related Unix commands

% users

displays a simple list of users on your local host

% rusers -a {host}*

displays list of users on all hosts on local net

% who

% rwho

% w

all describe users logged on in more detail

Page 10: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Network related Unix commands

% hostname

displays your host name

% finger {userId}*

display personal information about users

Page 11: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Communicating with other users

% mesg [y | n]

Enables or disables writing to your terminal

% write userId [tty]

% write userId [tty]

Writes line by line to the userId's terminal, stop using CTRL-D

Page 12: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Communicating with other users

% talk userId [tty]

Interactive writing (split screen)

% wall

Write all

Page 13: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Moving Around

% rlogin host

% ftp host

% telnet host

% rsh host command

% ssh host

% sftp host

Page 14: Chapter 9 Networking Graham Glass and King Ables, UNIX for Programmers and Users, Third Edition, Pearson Prentice Hall, 2003. Original Notes by Raj Sunderraman

Review

Ethernet

Internet

Information about others

Communicating with others

Remote commands and access