IP and Networking Basic

44
Appendix 1 IP and Networking Basics

Transcript of IP and Networking Basic

Page 1: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 1/44

Appendix 1

IP and Networking Basics

Page 2: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 2/44

Introduction Standalone computers.

Computers in a network.

Different applications/servicesbetween computers: e-mail, FileTransfer, Remote Login, Web

Surfing, Network Management,chatting, playing games etc.

Appendix 2

Page 3: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 3/44

Appendix 3

Packet Switched Network Usual telephone network is circuit switched

o For each call, a dedicated circuit is establishedo Dedicated bandwidth

Modern data networks are packet switchedo Data is chopped up into discrete packetso Packets are transmitted independentlyo No real circuit is established

o More efficient bandwidth usageo But more complex than circuit switched

Page 4: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 4/44

Appendix 4

Network Protocols

Study of networking focused on protocols Networking protocols precisely specify the

communication rules Details are given in RFCs

o RFC is effectively an Internet standard

Stateless protocols don·t remember Stateful protocols do remember

Page 5: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 5/44

To achieve interworking betweencomputers & other devices likeservers, routers etc the computer ismade to work in a hierarchical mannerie it is to work as a layered model.Each layer doing certainfunctionalities & offering services to

its upper layer.

Appendix 5

Page 6: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 6/44

6

International Standard Organisation (ISO) devised a7 layered model called Open System Interconnection(OSI model)

OSI Model

OSI Model

PHYSICAL

DATA LINK

NETWORK

TRANSPORT

SESSION

PRESENTATION

 APPLICATION

PHYSICAL

DATA LINK

NETWORK

TRANSPORT

SESSION

PRESENTATION

 APPLICATION

A B

Page 7: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 7/44

Each computer has this OSI model

embedded in it. Whenever any computer wants to

communicate with any other computer

or entity it will adopt a set of rulesagreeable to all the computers &entities in the network. This set ofrules is called Protocol. Each layer

communicates with its peer layer usinga protocol before actual data transfertakes place.

Appendix7

Page 8: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 8/44

So we require a stack of protocolcalled Protocol Suite to effectcommunication between computers ina network.

Different protocol suites areavailable like:

(a) AppleTalk (d) TCP/IP

(b) OSI (e) DECnet(c) IPX/SPX (f) XNS

Appendix8

Page 9: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 9/44

Appendix9

IP Protocols Internet or IP technology over the years hasemerged as the most prominent datacommunication technology.

TCP/IP protocol has become de-facto datacomm standard throughout the world.

It can carry even voice/video also over IPprotocol and in turn has started challengingthe complete monopoly of TDM technology invoice communication.

Page 10: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 10/44

Appendix10

TCP/IP and OSI OSI is made of seven layers.

TCP/IP protocol is made of five layers.

PHYSICAL

DATA LINK

NETWORK

TRANSPORT

 APPLICATION

PHYSICAL

DATA LINK

NETWORK

TRANSPORT

SESSION

PRESENTATION

 APPLICATION

OSI Model TCP/IP Model

Page 11: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 11/44

Appendix11

TCP/IP Protocol Suite

D

N

T

A

ICMP IGMPRARPARP

FTPSMTP

TELNETHTTP

TFTPNFS

SNMPDNS

TCP UDP

IP

Protocols defined by the underlying networks

P

Ethernet, Token Ring, FDDI, HDLC,FR, PPP, ATM

Page 12: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 12/44

Appendix12

Network Includes

o Computers

oServerso Routers

o Wireless devices

o Etc.

Purpose is totransmit data

Page 13: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 13/44

Appendix13

Network Edge

Network edgeincludes

Hostso Computerso Laptopso Servers

o Cell phoneso Etc., etc.

Page 14: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 14/44

Appendix14

Network Core

Network coreconsists ofo Interconnected

mesh of routers

Purpose is tomove data fromhost to host

Page 15: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 15/44

Appendix15

Layering in Action

application

transport

network

link

physical

application

transport

network

link

physical

network

link

physical

data data

At source, data goes down the protocol stack Each router processes packet up to network layer

o That·s where routing info lives Router then passes packet down the protocol stack Destination processes up to application layer

o That·s where the data lives

hosthost

router

Page 16: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 16/44

Appendix16

Encapsulation X = application data at the source

As X goes down protocol stack, eachlayer adds header information:o Application layer: (H, X)

o Transport layer: (H, (H, X))

o Network layer: (H, (H, (H, X)))

o Link layer: (H, (H, (H, (H, X))))

Header has info required by layer Note that app header is on the inside

application

tr ansport

network

link

physical

data X

packet 

(H,(H,(H,(H,X))))

Page 17: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 17/44

Appendix17

Application Layer Applications

o Web browsing, email, P2P, etc.o Run on hostso Hosts want network to be transparent

Application layer protocolso HTTP, SMTP, IMAP, Gnutella, etc., etc.

Protocol is one part of an applicationo For example, HTTP only part of Web browsing

Page 18: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 18/44

Appendix18

Client-Server Model Client ´speaks firstµ

Server tries to respond to request

Hosts are clients and/or servers

Example: Web browsingo You are the client (request web page)

o Web server is the server

Page 19: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 19/44

Appendix19

Peer-to-Peer (P2P) Model Hosts act as clients and servers For example, when sharing music

o You are client when requesting a fileo You are a server when someone downloads a filefrom you

In P2P model, more difficult for client tofind a server

Many different P2P models

Page 20: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 20/44

Appendix20

HTTP Example

HTTP --- HyperText Transfer Protocol Client (you) request a web page Server responds to your request

HTTP request

HTTP response

Page 21: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 21/44

Appendix21

Web Cookies

HTTP is stateless --- cookies used to add state Initially, cookie sent from server to browser Browser manages cookie, sends it to server Server looks in cookie database to ´rememberµ you

initialsession

any latersession

cookie

cookie

Cookiedatabase

Page 22: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 22/44

Appendix22

Web Cookies Web cookies can be used for

o Shopping carts

o Recommendations, etc.o A weak form of authentication

Privacy concernso Web site can learn a lot about youo Multiple web sites could learn even more

Page 23: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 23/44

Appendix23

SMTP SMTP used to send email from sender to

recipient·s mail server Then use POP3, IMAP or HTTP (Web mail)

to get messages from server As with many application protocols, SMTP

commands are human readable

SMTPPOP3

Sender RecipientSMTP

Page 24: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 24/44

Appendix24

Application Layer DNS --- Domain Name Service

o Convert human-friendly names such aswww.google.com into 32-bit IP address

o A distributed hierarchical database

Only 13 ´rootµ DNS servers worldwide

Page 25: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 25/44

Appendix25

Transport Layer The network layer offers unreliable, ´best

effortµ delivery of packets Any improved service must be provided by

the hosts Transport layer has two protocols

o TCP � better service, more overheado UDP � minimal service, minimal overhead

TCP and UDP run on hosts, not routers

Page 26: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 26/44

Appendix26

TCP

TCP assures that packetso Arrive at destinationo Are processed in ordero Are not sent too fast for receiver (flow control)

TCP also provideso Network-wide congestion control

TCP is ´connection-orientedµo TCP contacts server before sending datao Orderly setup and take down of ´connectionµo But no true connection, only a logical connection

Page 27: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 27/44

Appendix27

TCP Header

Source and destination port Sequence number Flags (ACK, SYN, RST, etc.) 20 bytes (if no options)

Page 28: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 28/44

Appendix28

TCP Three Way Handshake

SYN: synchronization requested SYN-ACK: acknowledge SYN request

ACK: acknowledge msg 2 and send data Then TCP ´connectionµ established

o Connection terminated by FIN or RST packet

SYN request

SYN-ACK

ACK (and data)

Page 29: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 29/44

Appendix29

Denial of Service Attack The TCP 3-way handshake makes denial of

service (DoS) attacks possible

Whenever SYN packet is received, servermust remember ´half-openµ connectiono Remembering consumes resources

o Too many half-open connections and server

resources will be exhaustedo Then server can·t respond to new connections

Page 30: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 30/44

Appendix 30

UDP UDP is minimalist, ´no frillsµ service

o No assurance that packets arriveo No assurance packets are in order, etc., etc.

Why does UDP exist?o More efficient (smaller header)o No flow control to slow down sendero No congestion control to slow down sender

Packets sent too fast, they will be droppedo Either at intermediate router or at destinationo But in some apps this is OK (audio/video)

Page 31: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 31/44

Appendix 31

Network Layer Core of network/Internet

o Interconnected mesh of routers

Purpose of network layer

o Route packets through this mesh Network layer protocol is IPo Follows a ´best effortµ approach

IP runs in every host and every router Routers also run routing protocols

o Used to determine the path to send packetso Routing protocols: RIP, OSPF, BGP, etc.

Page 32: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 32/44

Appendix 32

IP Addresses

IP address is 32 bits

Every host has an IP address

Not enough IP addresses!

o Lots of tricks to extend address space IP addresses given in dotted decimal notation

o For example: 195.72.180.27

o Each number is between 0 and 255

Host·s IP address can change

Page 33: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 33/44

Appendix 33

Socket

Each host has a 32 bit IP address But many processes on one host

o You can browse web, send email at same time

How to distinguish processes on a host? Each process has a 16 bit port number

o Port numbers < 1024 are ´well-knownµ ports(HTTP port 80, POP3 port 110, etc.)

o Port numbers above 1024 are dynamic (as needed)

IP address and port number define a socketo Socket uniquely identifies a process

Page 34: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 34/44

Appendix 34

IP Header

IP header used by routers

o Note source and destination IP addresses Time to live (TTL) limits number of ´hopsµ

o So packets can·t circulate forever

Fragmentation information (see next slide)

Page 35: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 35/44

Appendix 35

IP Fragmentation

Each link limits maximum size of packets

If packet is too big, router fragments it Re-assembly occurs at destination

re-assembled

fragmented

Page 36: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 36/44

Appendix 36

IP Fragmentation One packet becomes multiple packets Packets reassembled at destination

o Prevents multiple fragmentation/re-assemble

Fragmentation is a security issue!o Fragments may obscure real purpose of packeto ´Fragmentsµ can overlap when re-assembledo Must re-assemble packet to fully understand ito Lots of work for firewalls, for example

Page 37: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 37/44

Appendix 37

IPv6

Current version of IP is IPv4

IPv6 is a new-and-improved version

IPv6 provideso Longer addresses: 128 bits

o Real security ´built-inµ (IPSec)

But difficult to migrate from v4 to v6

So IPv6 has not taken hold yet

Page 38: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 38/44

Appendix 38

Link Layer Link layer sends

packet from onenode to next

Each link can bedifferento Wiredo Wireless

o Etherneto Point-to-point«

Page 39: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 39/44

Appendix 39

Link Layer Implemented in adapter known as

network interface card (NIC)

o Ethernet cardo Wireless 802.11 card, etc.

NIC is (mostly) out of host·s control

o Implements both link and physical layers

Page 40: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 40/44

Appendix 40

Ethernet

Ethernet is a multiple access protocol Many hosts access a shared media

o On a local area network, or LAN

In ethernet, two packets can collideo Then data is corruptedo Packets must be resento How to be efficient in distributed environment?

o Many possibilities, ethernet is most popular We won·t discuss details here

Page 41: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 41/44

Appendix 41

Link Layer Addressing

IP addresses live at network layer Link layer also requires addresses

o MAC address (LAN address, physical address)

MAC addresso 48 bits, globally uniqueo Used to forward packets over one link

Analogy

o IP address is like home addresso MAC address is like social security number

Page 42: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 42/44

Appendix 42

ARP Address resolution protocol, ARP Used at link layer to find MAC address of

given IP address Each host has ARP table

o Generated automaticallyo Entries expire after some time (20 min)o ARP used to find ARP table entrieso ARP table also known as ARP cache

Page 43: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 43/44

Appendix 43

ARP

ARP is stateless ARP sends request and receives ARP reply Replies used to fill ARP cache

IP: 111.111.111.001 IP: 111.111.111.002

MAC: AA-AA-AA-AA-AA-AA MAC: BB-BB-BB-BB-BB-BB

111.111.111.002BB-BB-BB-BB-BB-

BB111.111.111.001

AA-AA-AA-AA-AA-

AAARP cache ARP cache

LAN

Page 44: IP and Networking Basic

8/7/2019 IP and Networking Basic

http://slidepdf.com/reader/full/ip-and-networking-basic 44/44

THANKS

Appendix 44