Upload
ayala
View
155
Download
0
Embed Size (px)
DESCRIPTION
Linux 下的网络应用及管理. 何斌武 大工网络中心 Email: [email protected] BBS: [email protected]. 版权声明. 本文内容为大连理工大学 LINUX 选修课讲义,欢迎大家转载,但禁止使用本材料进行任何商业性或赢利性活动。转载时请保留本版权声明。 URL: ftp://ftp.dlut.edu.cn/pub/PEOPLE/albin/ 何斌武, [email protected], 大连理工大学网络中心 May 1999. 课程内容. Linux 介绍 - PowerPoint PPT Presentation
Citation preview
Linux Email: [email protected]: [email protected]
LINUX
URL: ftp://ftp.dlut.edu.cn/pub/PEOPLE/albin/
[email protected],May 1999.
LinuxLinuxTCP/IPUNIXLinuxInternetDNSFTPWWW(HTTP)LAN Router/FirewallSMTP()/POP3
LinuxLinuxLinuxPPPXFree86 Shell ScriptCGI
UNIXInternetLINUX
LINUX LINUX LINUX
LINUX1.1 LINUXInternetUNIXUNIXMS$ ISP POSIXBSDSYSVLinus B. Torvalds([email protected])GPLIntell 80x86, Pentium MMX, Pentium II, Pentium III, AMD
Sun Sparc, DEC, Power PCX Windows, GNU C/C++, Sybase, Oracle, Netscape, StarOffice, DOS EMU, (PPP/HTTP/FTP/DNS SMTP/POP3/Firewall/BBS/samba/mars).TCP/IP, Novell IPS/SPX, NetBEUI, AppleTalk, X.25,ArcNet1.2 Linux1991.8 Linux 0.011991.10.5 Linux 0.02()0.03 ->0.10 1992Linux 0.95(0.99p114)1994.3.14Linux 1.0 2.2.3/2.0.36
1.3 Linux
1.3.1 UNIXUNIXCI/O(system call)fork()pipe()cc,troff, grep,awkshell. 60 MULTICS(Multiplexed Information and Computing Services)1969 Ken Thompson, Dennis Ritchie PDP-111971 V1 PDP-11/20FSfork,roff,ed1973 V4 C1975 V6 UNIX1.X BSD1778 BSD, Bill Joy. Chuck Hally1979 V7 UNIXK&C Csh
UNIXSystem V(AT&T)BSD SVR4,OSF/1UNIXAIX: SVR2BSDSMITFreeBSD: Intel 80x86Free1.X386BSD2.X4.4BSD Lite2.2.8-RELEASE/3.1.0-RELEASEftp://ftp.dlut.edu.cn/pub/FreeBSD/HP-UX(HP): S III(SVRX),SVR2 4.2BSD OSF/1IRIX(SGI): V4(SVR 3.2,BSD)V5(SVR4)Linux(x86):POSIX; SYSVBSDOSF/1DEC DECUNIXSCO UNIX(x86): SVR 3.2, UNIX
SunOS(680x0,Sparc,i386)SunOS 4.x(BSD 4.1c)Solaris(SunOS 5.x, SVR4)NFS, Openlookultirx(DEC):Xinux(x86): MicrosoftSVRBSD()
1.3.2 LinuxBuffer Overflow
SVRXBSD
SVRX
xBSD
Kernel
/unix
/vmunix(Linux)
/etc/inittab(Linux)
/etc/ttys
/etc/rc.d/*(linux)
/etc/rc.*
/etc/mntab
/etc/mtab(Linux)
shell
sh, ksh
csh
Lp,lpstat,cancel
Lpr,lpq,lprm,lpd
(Linux)
termio,terminfo,
svr4:termios
Termios,
termcap(Linux)
Ps ef
Ps aux
/proc
swap, swap128Mx16=2GBLD_PRELOADcore dump: (pseudo terminal,pty)(Alt+F1~F6,Alt+Arrow)CPUIntelLinuxHD/FD/Mainboard/SCSI/Audio/CDROM/MO, NIC,ZIP/MOVideext2fs2TB255umsdosDOSLinux
POSIXUNIXUNIXshell: news/mail
Xcxterm,crxvtwgce,chdrv,yactxa+xcainhzttycnprintdosemu,wine,WABI(SUN,)WWW Browser: Netscape,Mosaic,lynx,ArenaFreeBSDUNIXPOSIXSystem V,BSDUNIXiBCS2SCOUNIXTCP/IP(ftp,telnet,NFS)Linux TCP,IPV4,IPV6,AX25,X.25,IPX, DDP(AppleTalk),NetBEUI
TCP,IPV4,IPV,DDP,AX25NetwaresambaLinuxWindowsWindows 9x/NT
1.3.3 Linux(kernel)(Distribution)Linus2.2.32.0.36Linuxslackware,RedHat, DebianLinux Linus
Linux (1)Walnut Creek Slackwareftp://ftp.cdrom.com, Walnut Creek CDROMSlackwareLinux/Redhat RedhatDebian, pkgtool, Latest Version: Slackware 3.6ftp://ftp.dlut.edu.cn/pub/Linux/slackware/ ftp://ftp.cdrom.com/pub/LinuxMirror: ftp://sunsite.ust.hk/pub/ (Free IP)
(2)RedHat Linux: (Latest is Redhat 5.2)Redhat Softwareslackware/debiandebianslackware(informix, sybase,oracleIntel).RPM/GNU shareware,PAMRPMURLftp://ftp.redhat.com/ftp://ftp.dlut.edu.cn/pub/Linux/redhat/redhat-5.2/
Redhatmandrake: ftp://ftp.dlut.edu.cn/pub/Linux/mandrake Plinux:Linux,KDE(3)Debian Linux:GNULinuxFTPLINUXshadowRedhatdebRPM
(,),dselect(4)Craftworks Linux: (5)Linux Pro: WGS(6)Linux:TurboLinux, TurboLinuxCaldera OpenLinux
1.4 Linuxftp://ftp.dlut.edu.cn/pub/Linux/CDROM: FAQ: Redhat/usr/doc/* LinuxFAQBBSbbs.dlut.edu.cnbbs.tsinghua.edu.cn
1.5 LINUX LinuxLinuxInternet Redhat LinuxLinuxGNU
Linux
UNIX
TCP/IPIP
(Internetworking)(The Internetworking model)(Applications and Up Layers)(Physical and data link layers)(Network layer and path determination)
(The Internetworking Model)ISO/OSI
60-70: 70-80: 80-90: 90:
60-70:(),.IBMSNAX.25,,,,,.,,(addressing), ,.
70-80:PCLAN,LAN,,EMAIL,LAN,WAN,(),,. DEC VAXDECnet.
80-90:,,,,,,(flexible),(scalable),(,)LAN/WAN/,.
90:,,bandwidth on demand, ,,: ,,C/S.,,.
LAN:(control the network privately under local administration) 24(connect physically adjacent devices)
:,,(PC),,,.,DOWN,: (To be continued)
()::,,,.. .;Token-Ring;.(HUB): ,,.,LAN,,HUB.:,,,VLAN.
()::,, ,,.ATM(Asynchronous Transfer Mode): (high-speed cell switching).(repeater):,..,,,.,(),,.: 100Mbps.
WAN:24:,WANWANWANDOWN,,,(To be continued)
(),:(router)::X.25, Frame Relay, , .,,.Modem, CSU/DSU(channel service units/digital service units)T1/E1,TA/NT1(Terminal Adapters/Network Termination 1)ISDN(Integrated Services Digital Network)(): /(Multiplexes):WAN(share a WAN facility among several demand channels)ATM:
:(design)(operations)(troubleshooting)
:(connectivity): ,,(reliable performance):.(management control): ,.,.(flexibility): ,.
(The Layered Model)Why a Layered Network Model?Layer FunctionsPeer-to-Peer CommunicationsData Encapsulation()Data Encapsulation Example
Why a Layered Network Model?,,plug-and-play,,.(accelerates evolution), ,(Simplifies teaching and learning),,.OSI
Layer FunctionsNetwork processes to applications, ,,telnetFTPData representation, ,Interhost communication, ,,()End-to-end connections,;Address and best path, ,,Access to media,,,Binary transmission,
PDU: protocol data units, PDU,TCPsegment,;PDU,TCP segment.
(frame):.(),..(packet): .(),..(datagram):.(segment):.(message):().(cell):,.ATMSMDS.
;PDU,();.
1.2.,,(segment)Email.3.segmentpacket,packet,.4.,,.5.()(a pattern of ones and zeros), .*,.
Applications and Upper LayersSections:Application, Presentation, and Session LayersTransport Layer
Objectives: Upon completion of this chapter, you will be able to :Name and describe computer,network,and internetwork applicationsDescribe the OSI presentation-layer functions and identify common standardsDescribe the OSI session-layer functions and identity common standardsDescribe the OSI transport-layer functions for end-to-end network servicesIdentify common processes for establishing connections, flow control, and windowing
Application, Presentation, and Session Layers
Application LayerSelect network application to support users application
OSI,OSI.OSI
Application Layer(Cont.).Internetwork applications can extend beyond the enterprise
EDIWWWX.400SMTPBBSInternet
Presentation Layer
(data transfer syntax)EBCDICASCII
Session Layer
NFS(Network File System)SUNUNIXTCP/IPSQL(Structured Query Language)IBMRPC(Remote Procedure Call)(build)X Windows:UNIXASPAppleTalk Session ProtocolDNA SCPDigital Network Architecture Session Control Protocol
(Transport Layer)
()(segment)bufferbuffer(acknowledge back)
OSI(is accomplished segment by segment)
(originating)
0 1024UNIXroot/etc/services
(Connection-Oriented Sessions)
(peer system)OS(authorized)
(Flow Control)
()(not ready)
(Reliability with Windowing)
Reliability with Windowing(Cont.)Window.(Windowing)(packet)TCP/IP
(Positive Acknowledgment)
Positive Acknowledgment (Cont.)(positive)55 5ACK 7 7
(Transport to Network Layer)
Physical and Data-Link Standards
()()()()RS-232C/DLANWAN
LAN Data Link Sublayers
OSIIEEELLCLLCMACLLCIEEE 802.2, MAC
LANLAN,/(CSMA/CD,carrier sense multiple access collision detect)(Token Passing)CSMA/CD,,,CSMA/CD(contention access). LAN/IEEE802.3,100BaseT.,.LAN/IEEE802.5FDDI.LAN(unicast),(multicast)(broadcast).
LLCLLC802MACLLC802MACLLCLLC/
Physical and Logical Address,IPAppleTalk,
MAC Address
MAC()MACMAC(OUI,Organization Unique Identifier)IEEEMACARPMACTCP/IPHelloMACMACMACXeros(XNS)Novell IPXDECnet Phase IV
Finding the MAC Address
MAC
AMACB 0000.0c12.2222 D 0000.0c12.3333BMACA 0000.0c12.1111 D 0000.0c12.3333DMACA 0000.0c12.5555 B 0000.0c12.5555CMACA 0000.0c12.1111 B 0000.0c12.2222D 0000.0c12.4444
LAN Technology Overview
(Ethernet):XeroxXerox,Intel,DECLANCSMA/CD10Mbps,;IEEE802.3(Token-Ring): IBM416MbpsIBM;IEEE802.5FDDI(Fiber Distribution Data Interface)100Mbps2
Ethernet and IEEE 802.3
Physical Layer: Ethernet/802.3
: Ethernet/802.310Mbps.10Base2: 185m10Base5: 500m10BaseT: 100m
IEEE802.3
IEEE 802.3
10Base5
10base2
10baseT
10baseFL
100BaseT
10
10
10
10
10
100
(m)
500
500
185
100
2000
100
50
50
50
Ethernet/802.3 Operation
CSMA/CD,.,(terminator).100PC,100A,BC,;D,
Ethernet/802.3 Broadcast:.1(FFFF:FFFF:FFFF).,AB/C/D.(multicast address):,group address();.
8Bytes
6
6
2
46~1500
FCS
4
Ethernet
7
SOF
6
6
802.2
FCS
4
IEEE802.3
1. (preamble);SOF,
2. ;802.3,802.2
3. FCS,CRC,,.
Ethernet/802.3
100BaseFX:62.5/125,400M,MAC802.3MAC,100Mbps100BaseT4:43/4/5,100M,200M,MAC802.3MAC,100Mbps 100BaseTX:(1,2,3,6)51/2STP,200M,MAC802.3,100Mbps100VG-AnyLan:43245,(UTP),HPCSMA/CD,,100BaseT;,CSMA/CD. (100/150, 600/900).:IEEE802.3,1000Mbps.
Token-ring FDDIToken-ring: IEEE802.5, MSAU(Multistation access Unit)FDDIANSI X3T9.5100Mbps(),
:(Path Determination),,():(best effort end-to-end packet delivery),.
:,,,,,
: : :
TCP/IP
TCP/IP
TCP/IP(Universal),LANWAN.
TCP/IPIP(MTU)
(Transport Layer)
():(1)(sliding windows);(2)(sequence numbers):TCPUDPTCP,,,. TCP.,,,.,TCP,,,TCP.TCP,.
()UDP,.UDP,.UDP,UDP,. UDP:DNS,SNMP, TFTP, BOOTP, SYSLOG, RADIUS(Remote Authenticate DialIn User Server).
TCP
0 31
IHL
(Sequence Number)
(Acknowledgement Number)
HLEN
(Window)
I
TCP()/:TCP:;,(ACK. No.):.HLEN:TCP,32bits(4).:0:,SYNACKFIN.Window:(octets),(checksum):Urgent: :
TCPUDP(SOCKET).RFC1700Well Known Port Number.256,2561023;1023UNIX,root1023.UNIX/etc/services
TCP
TCP:
()
TCP:
TCP:(Windowing)
TCP
UDP
Bits 16 16 16 16 .
(Internet Layer)
(Network Layer)OSITCP/IP
OSITCP/IPIPIP(TCP/UDP)ICMPARPIP(IP->MAC)RARPARPIP(MAC->IP),
IP
0 4 8 16 31
IHL
IP
IP
IP
IP(VERS):4(IPV4),IPV66HLEN():IP32IP+MTU(Ethernet/PPP/X.25)(allowing differing MTUs in the internet)TTL:(Time To Live),:(TCP/UDP)IPIPIP32IPIP
IP()IPTCPIPIP()IP
ICMP
ICMPTCP/IPICMPICMPIPICMP:Destination UnreachableTime ExceededParameter ProblemSource QuenchRedirectEchoEcho ReplyTimestampTimestamp ReplyAddress Request/Address
ICMP
ICMP()pingICMP Echo Request,ICMP Echo
ARPMap IP to EthernetLocal ARP
TCP/IPWWW(Acknowledged, TCP)(UDP)ICMP
TCP/IP
IP: 32(locationIPIP
IPIP32bits202.118.66.188(octet)bit (128,64,,4,2,1)(octet)0255(1)IP(InterNIC)
IPIP254AA16777214 (256*256*256-2)64000BB640001600CC254IP
8 Bits 8 Bits 8 Bits 8Bits
A
B
C
D(multicast)224.x.x.x239.x.x.x
E,240.x.x.x
IPA01.0.0.0126.0.0.0,126A16,000,000B10,128.0.0.0191.255.0.0, B65,000C110192.0.0.0223.255.255.0,C254D224.0.0.0239.255.255.0.
8 Bits 8 Bits 8 Bits 8Bits
A
0xxxxxxx
B
10xxxxxx
C
110xxxxx
IP
IP
Class
10.2.100.3
A
10.
2.100.3
128.63.4.100
B
128.63
4.100
201.225.9.8
C
201.225.9
8
192.6.142.9
C
192.6.142
9
130.113.64.16
B
130.113
64.16
256.241.201.10
IP
10.0.0.00.2.1.1
IP
()1IP0(202.118.66.0),TCP/IP()IP(Local Address)()IP202.118.66.0IP202.118.66.1202.118.66.254, (IP Forward).
IP:B65000;.
IP:IPIPIP32bit10
()IP
IP:32IP11202.118.66.8:255.255.255.0202.118.66.8/24
()C202.118.72.020,5(),255.255.255.248.202.118.72.0/255.255.255.248: IP 202.118.72.0~202.118.72.7,202.118.72.0,202.118.72.7,202.118.72.1~202.118.72.6,IP.202.118.72.16/255.255.255.248: IP: ?,?,?
()172.16.2.0172.16.2.1 -- 172.16.2.254172.16.2.255
() Internet+11172.163172.16.3.255,172.16172.16.255.255 Flooding:255.255.255.255,255.255.255.255172.16.1.255;
Class
201.2.10.60/29
255.255.255.248
26.4.3.18/21
255.255.248.0
172.16.32.4/30
255.255.255.252
159.226.4.1/25
255.255.255.128
IPIPID32 IDIPping
Email:[email protected]; BBSbbs.dlut.edu.cn(LINUX/UNIX/Networking)