Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header...

30
Internet Internet An Introduction An Introduction

Transcript of Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header...

Page 1: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

InternetInternet

An IntroductionAn Introduction

Page 2: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

22/30/3028.02.0628.02.06

PacketPacket

Information sent in packetsInformation sent in packets HeaderHeader

sender sender receiverreceivertype of servicetype of servicechecksumchecksum

BodyBodydatadata

size = 1500 - 65000 bytessize = 1500 - 65000 bytes

Page 3: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

33/30/3028.02.0628.02.06

IP layersIP layers

Physical layerPhysical layer unreliable connection between two computersunreliable connection between two computers

Link layerLink layer reliable connection between two computersreliable connection between two computers

IP layerIP layer reliable connection between two computers across the LANreliable connection between two computers across the LAN

TCP/UDP layerTCP/UDP layer ““virtual” connectionsvirtual” connections portsports

Application layerApplication layer HTTP, mail, ...HTTP, mail, ...

ISO/OSI Reference model – session and presentation layerISO/OSI Reference model – session and presentation layer

Page 4: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

44/30/3028.02.0628.02.06

Physical and link layerPhysical and link layer

Physical layerPhysical layer ensures data sending/receiving ensures data sending/receiving Ethernet, RS 232, WiFi, ATM, Novell, …Ethernet, RS 232, WiFi, ATM, Novell, …

Link layer - EthernetLink layer - Ethernet corrects errors of physical layercorrects errors of physical layer each net card has its own (unique) MAC each net card has its own (unique) MAC

(Machine Address Code) address(Machine Address Code) address 00-11-D8-C8-D6-6A00-11-D8-C8-D6-6A

Page 5: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

55/30/3028.02.0628.02.06

IP protocolIP protocol

sends data across heterogeneous sends data across heterogeneous networksnetworks

routerroutercontrols a subnet of the Internetcontrols a subnet of the Internet

source – target addresssource – target address IP address - 32-bit numberIP address - 32-bit number

Page 6: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

66/30/3028.02.0628.02.06

IP addressIP address

IP: IP: 10011110.11000011.10101010.10xxxxxx10011110.11000011.10101010.10xxxxxx 158.195.85.?158.195.85.?

mask:mask: 11111111.11111111.11111111.1100000011111111.11111111.11111111.11000000 255.255.255.192255.255.255.192

special addressesspecial addresses network = 158.195.85.128network = 158.195.85.128 broadcast = 158.195.85.191broadcast = 158.195.85.191

Page 7: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

77/30/3028.02.0628.02.06

ICMP and other IP protocolsICMP and other IP protocols

Internet Control Message ProtocolInternet Control Message Protocol pingping

echo requestecho request

echo replyecho reply destination unreachabledestination unreachable TTL exceededTTL exceeded

Other IP protocolsOther IP protocols IGMP, ARP, RARP, BOOTP, DHCP, TCP, IGMP, ARP, RARP, BOOTP, DHCP, TCP,

UDPUDP

Page 8: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

88/30/3028.02.0628.02.06

Static vs. dynamic IPStatic vs. dynamic IP

Static addressStatic address manual IP address, mask, DNS server settingmanual IP address, mask, DNS server setting

DHCP protocol (based on BOOTP)DHCP protocol (based on BOOTP) Dynamic Host Control ProtocolDynamic Host Control Protocol given a MAC address IP address of some IP given a MAC address IP address of some IP

address rangeaddress range also gives information about correct netmask also gives information about correct netmask

and DNS information for a particular LAN and DNS information for a particular LAN networknetwork

Page 9: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

99/30/3028.02.0628.02.06

TCP/UDPTCP/UDP

TCP (Transmission Control Protocol)TCP (Transmission Control Protocol) the most common connection-oriented the most common connection-oriented

protocol protocol most of Internet services use this protocol most of Internet services use this protocol

POP3, ...POP3, ...

UDP (User Datagram Protocol)UDP (User Datagram Protocol) no check, whether the data was received no check, whether the data was received

correctly correctly video, SMB, P2Pvideo, SMB, P2P

Page 10: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

1010/30/3028.02.0628.02.06

PortPort

Every (virtual) connection between two Every (virtual) connection between two computer uses some portcomputer uses some port Well-known ports < 1024Well-known ports < 1024

used for some well-known services FTP, HTTP, used for some well-known services FTP, HTTP, SSH, ... SSH, ...

Dynamic ports > 1024Dynamic ports > 1024secondary communication and data transfersecondary communication and data transfer

Page 11: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

1111/30/3028.02.0628.02.06

Packet examplePacket example

Page 12: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

1212/30/3028.02.0628.02.06

Communication exampleCommunication examplePOP3 service = port 110POP3 service = port 110telnet sccg.sk 110telnet sccg.sk 110

Trying 158.195.85.131...Trying 158.195.85.131... Connected to sccg.sk (158.195.85.131).Connected to sccg.sk (158.195.85.131). Escape character is '^]'.Escape character is '^]'. +OK POP3 fractal.dam.fmph.uniba.sk 2004.89mdk server ready+OK POP3 fractal.dam.fmph.uniba.sk 2004.89mdk server ready

user kubiniuser kubini +OK User name accepted, password please+OK User name accepted, password please

pass tralalapass tralala +OK Mailbox open, 3 messages+OK Mailbox open, 3 messages

retr 2retr 2 +OK 386 octets +OK 386 octets Return-Path: Received: (from user.123@localhost) by pop.foo.bar (8.8.8/8.8.8) id Return-Path: Received: (from user.123@localhost) by pop.foo.bar (8.8.8/8.8.8) id

SAA29614 for user.123; Wed, 3 Dec 1997 18:55:43 -0500 (EST) Date: Wed, 3 SAA29614 for user.123; Wed, 3 Dec 1997 18:55:43 -0500 (EST) Date: Wed, 3 Dec 1997 18:55:43 -0500 (EST) From: Pat Gunn …Dec 1997 18:55:43 -0500 (EST) From: Pat Gunn …

dele 1dele 1 +OK Message 2 has been deleted.+OK Message 2 has been deleted.

quitquit+OK Sayonara+OK Sayonara

Page 13: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

1313/30/3028.02.0628.02.06

SummarySummary

InternetInternet

PacketsPackets ICMP (Internet Control Message Protocol)ICMP (Internet Control Message Protocol) IP (Internet Protocol)IP (Internet Protocol) TCP/UDP (Transmission Control Protocol, TCP/UDP (Transmission Control Protocol,

User Datagram Protocol)User Datagram Protocol) PortsPorts Application specific informationApplication specific information

Page 14: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

Server configurationServer configuration

Page 15: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

1515/30/3028.02.0628.02.06

Linux basicsLinux basics

bash (shell)bash (shell)man bashman bashcd, cp, mv, rm, w, ps, …cd, cp, mv, rm, w, ps, …path path

absolute : /home/kubini/public_htmlabsolute : /home/kubini/public_html relative public_htmlrelative public_html

home directoryhome directoryprompt : kubini@fractal:~prompt : kubini@fractal:~mountmount

/proc/proc /dev/dev /etc/etc /mnt/mnt /bin, /sbin, /usr/bin, /usr/sbin/bin, /sbin, /usr/bin, /usr/sbin

user, group - chmod, chown, chgrpuser, group - chmod, chown, chgrp

Page 16: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

1616/30/3028.02.0628.02.06

MAIL(SMTP, POP3)MAIL(SMTP, POP3)

mail sendingmail sending postfix = /etc/postfix/main.cf, /etc/init.d/postfix/restartpostfix = /etc/postfix/main.cf, /etc/init.d/postfix/restart

mail receivingmail receiving pop3(Post Office Protocol) = /etc/xinetd.d/pop3(s)pop3(Post Office Protocol) = /etc/xinetd.d/pop3(s)

unsecured protocolunsecured protocolmails are stored on the client (usually)mails are stored on the client (usually)

imap(Internet Mail Access Protocol) = imap(Internet Mail Access Protocol) = /etc/xinetd.d/imap(s)/etc/xinetd.d/imap(s)

newer safer protocolnewer safer protocolmails are stored on the servermails are stored on the server

/etc/init.d/xinetd restart/etc/init.d/xinetd restart

client = mail, pine, kmailclient = mail, pine, kmail

Page 17: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

1717/30/3028.02.0628.02.06

DNSDNS

158.195.85.151 (ns.dam.fmph.uniba.sk)158.195.85.151 (ns.dam.fmph.uniba.sk)www.zoznam.skwww.zoznam.sk <-> 62.65.179.31 <-> 62.65.179.31MX, PTR, A, CNAMEMX, PTR, A, CNAMEhierarchical DNS name structurehierarchical DNS name structure .uniba.sk.uniba.sk .fmph.uniba.sk.fmph.uniba.sk .dai.fmph.uniba.sk.dai.fmph.uniba.sk

/etc/named.conf/etc/named.conf /var/named/…/var/named/… /etc/init.d/named restart/etc/init.d/named restart

client = dig, host – nslookup, ping -aclient = dig, host – nslookup, ping -a

Page 18: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

1818/30/3028.02.0628.02.06

Webserver (httpd)Webserver (httpd)

Apache(Pyramid)Apache(Pyramid) server webpages (sccg.sk, …)server webpages (sccg.sk, …) user webpagesuser webpages

ConfigurationConfiguration vim /etc/httpd/conf/httpd2.conf, /etc/php.inivim /etc/httpd/conf/httpd2.conf, /etc/php.ini /etc/init.d/httpd restart/etc/init.d/httpd restart

Client = lynx, links, mozilla, IEClient = lynx, links, mozilla, IE

Page 19: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

1919/30/3028.02.0628.02.06

DatabaseDatabase

MySQL server(fractal)MySQL server(fractal) port 3306port 3306 configurationconfiguration

vim /etc/my.cnfvim /etc/my.cnf

/etc/init.d/mysqld restart/etc/init.d/mysqld restart relational databaserelational database SQL (Structured Query Language)SQL (Structured Query Language)

ClientClienthttp://http://www.sccg.sk/phpMyAdminwww.sccg.sk/phpMyAdmin

mysql –u user –p passmysql –u user –p pass

Page 20: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2020/30/3028.02.0628.02.06

SMB(Server Message Block)SMB(Server Message Block)

Samba serverSamba server ports: TCP 139, 440, UDP 137, 138, …ports: TCP 139, 440, UDP 137, 138, … /etc/samba/smb.conf/etc/samba/smb.conf

WorkGroup(KG, KPGSO) = browstatWorkGroup(KG, KPGSO) = browstat

Domain (M-115)Domain (M-115)

Client: smbmount, smbclient, smbumount, Client: smbmount, smbclient, smbumount, explorer(explorer(\\fractal\pub\\fractal\pub), Windows shared disks), Windows shared disks net use Q: net use Q: \\fractal\pub\\fractal\pub /user:Administrator /user:Administrator print$, ipc$, … print$, ipc$, …

Page 21: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2121/30/3028.02.0628.02.06

FTP(File Transfer Protocol)FTP(File Transfer Protocol)

Server (not running)Server (not running) proftpdproftpd

/etc/proftpd.conf/etc/proftpd.conf

/etc/init.d/proftpd restart/etc/init.d/proftpd restart anonymous ftpanonymous ftp

ClientClient ftp, mc, explorer (ftp://...), Total Commanderftp, mc, explorer (ftp://...), Total Commander passive vs. active ftppassive vs. active ftp

Page 22: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2222/30/3028.02.0628.02.06

TelnetTelnet

Server (not running7)Server (not running7) Port 23Port 23 „„remote keyboard“remote keyboard“

ClientClient telnet (Linux and Windows)telnet (Linux and Windows)

Ctrl+] – if the connection gets broken Ctrl+] – if the connection gets broken

Page 23: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2323/30/3028.02.0628.02.06

SSH(Secure shell)SSH(Secure shell)

Secure shell serverSecure shell server Safe telnet replacementSafe telnet replacement /etc/ssh/sshd.conf/etc/ssh/sshd.conf /etc/init.d/sshd restart/etc/init.d/sshd restart

ClientClient SecureCRT, putty, ssh(Secure Shell)SecureCRT, putty, ssh(Secure Shell) scp(sftp), WinScp(Secure coPy – ftp scp(sftp), WinScp(Secure coPy – ftp

replacement) replacement)

Page 24: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2424/30/3028.02.0628.02.06

Firewall/RouterFirewall/Router

router:router: computer “responsible” for a subnetcomputer “responsible” for a subnet routes packets to/from the correct computersroutes packets to/from the correct computers

firewall:firewall: ensures safety of the subnetensures safety of the subnet iptables iptables firewall(off|on)firewall(off|on)

Page 25: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2525/30/3028.02.0628.02.06

Spam filterSpam filter

SpamAssassinSpamAssassin /etc/mail/spamassassin/local.cf/etc/mail/spamassassin/local.cf spam, whitelist, blacklist, ...spam, whitelist, blacklist, ...

Client configurationClient configuration ~/.spamassassin/local.cf~/.spamassassin/local.cf

similar to server configurationsimilar to server configuration

Page 26: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2626/30/3028.02.0628.02.06

Proxy serverProxy server

Proxy serverProxy server content based filteringcontent based filtering

fromfromtototype of servicetype of service

SQUID – application proxySQUID – application proxyapplication layer content filteringapplication layer content filteringM-115 has restricted access to KPGSO LANM-115 has restricted access to KPGSO LAN/etc/squid.conf/etc/squid.conf/etc/init.d/squid restart/etc/init.d/squid restart

Page 27: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2727/30/3028.02.0628.02.06

X-WindowsX-Windows

ServerServer X-Window X-Window

physical console Alt-F7physical console Alt-F7

local server = WinAxelocal server = WinAxe

ClientClient applicationsapplications

xterm, ...xterm, ...

kclock, kmailkclock, kmail

Page 28: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2828/30/3028.02.0628.02.06

DHCPDHCP

ServerServer dhcpddhcpd /etc/init.d/dhcpd restart/etc/init.d/dhcpd restart /etc/dhcpd/dhcpd.conf/etc/dhcpd/dhcpd.conf

dynamically assign IP address from some rangedynamically assign IP address from some rangeMAC filteringMAC filtering DHCP assigns IP address to computers with known DHCP assigns IP address to computers with known

MAC addressMAC address

ClientClient ipconfig /renew, …ipconfig /renew, …

Page 29: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

2929/30/3028.02.0628.02.06

Our LANOur LAN

Experiment (M-113, 158.195.85.147)

KPGSO LAN

Pracovné stanice

Fakultna LANFractal (M-123, 158.195.85.131)

MAIL (POP3, IMAP, SMTP)MYSQL

SSH, SCP, SFTP

Pyramid (M-123, 158.195.85.159)HTTP [php](WebMail

phpMyAdminWebStranky)

Ns(M-123, 158.195.85.151)DNS

M115-Proxy,M-115 NT Domain Controller

Torus, Tebe (158.195.85.129)Firewall

M115 - LAN

Scanner

Minolta (M-113, 158.195.85.154)HTTP

Canon (M-119)

Page 30: Internet An Introduction. 2/3028.02.06 Packet Information sent in packets Header Headersenderreceiver type of service checksum Body Bodydata size = 1500.

3030/30/3028.02.0628.02.06

ReferencesReferences

www.sccg.sk/~kubini/Internetwww.sccg.sk/~kubini/Internet

InternetInternet IBM TCP/IP referenceIBM TCP/IP reference RFC (Request for comments)RFC (Request for comments) GoogleGoogle

LinuxLinux manman standard documentation and Internet (google)standard documentation and Internet (google)

Interesting softwareInteresting software Ethereal (packet analyzer)Ethereal (packet analyzer)