Networking overview
Download
1 / 133

Networking Overview 1 Networking Overview - PowerPoint PPT Presentation


  • 344 Views
  • Updated On :

Networking Overview. TCP/IP. TCP/IP == Transmission Control Protocol/Internet Protocol Almost ubiquitous protocol for communication over network Many other networking protocols ATM, X.25, SS7, Sonet,… But TCP/IP has taken over the world. TCP/IP. Here, a brief overview of TCP/IP

Related searches for Networking Overview 1 Networking Overview

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Networking Overview 1 Networking Overview' - Roberta


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Networking overview l.jpg
Networking Overview

Networking Overview 1


Tcp ip l.jpg
TCP/IP

  • TCP/IP == Transmission Control Protocol/Internet Protocol

  • Almost ubiquitous protocol for communication over network

  • Many other networking protocols

    • ATM, X.25, SS7, Sonet,…

    • But TCP/IP has taken over the world

Networking Overview 2


Tcp ip3 l.jpg
TCP/IP

  • Here, a brief overview of TCP/IP

  • For more info, see, for example,

    • Computer Networks, Tanenbaum

    • Computer Networks and Internets, Comer

    • Computer Networking: A Top Down Approach Featuring the Internet, Kurose and Ross

    • TCP/IP Protocol Suite, Forouzan

Networking Overview 3


Why tcp ip l.jpg
Why TCP/IP?

  • Almost everywhere

  • Author developed payphone billing protocol in 1992

    • Used X.25, later ported to SS7

    • Today would almost certainly use TCP/IP

  • TCP/IP makes the world “extremely hackable”

Networking Overview 4


Osi reference model l.jpg
OSI Reference Model

  • In 1980, ISO developed OSI

    • Computer communication over network

  • Protocol layering

    • Breaks problem into small parts

    • Layer provides service to next higher

  • Modular

    • Makes it easy, for example, to replace Ethernet with wireless

Networking Overview 5


Osi reference model6 l.jpg
OSI Reference Model

  • Layer 7 --- Application Layer

    • Links application to the communication channel

  • Layer 6 --- Presentation Layer

    • How to represent bits for transmission

  • Layer 5 --- Session Layer

    • Coordinate (multiple) sessions

  • Layer 4 --- Transport Layer

    • Logical channel between systems

Networking Overview 6


Osi reference model7 l.jpg
OSI Reference Model

  • Layer 3 --- Network Layer

    • Move data from host-to-host, across network core (interconnected mesh of routers)

  • Layer 2 --- Data Link Layer (or Link Layer)

    • Move data across one “hop”

  • Layer 1 --- Physical Layer

    • Transmit bits across a physical link (fiber optic, copper cable, wireless, etc.)

  • Note: Layers 7,6,5 often treated as one

Networking Overview 7


Tcp ip our hero l.jpg
TCP/IP, Our Hero

  • Layers from TCP/IP’s perspective…

  • Application Layer --- Program trying to communicate using TCP/IP

    • E.g., email servers, SSH client and server, etc

  • Transport Layer --- Includes TCP and UDP

    • TCP provides reliable delivery

    • UDP is “bare bones” transport layer protocol

Networking Overview 8


Tcp ip our hero9 l.jpg
TCP/IP, Our Hero

  • Network Layer --- Based on IP

    • Deliver packets from end-to-end

    • To be cool, you must say “layer 3”

  • Data Link Layer --- One hop

    • “Layer 2”

  • Physical Layer --- The physical media

Networking Overview 9


Tcp ip protocol stack l.jpg
TCP/IP Protocol Stack

  • TCP/IP synonymous with transport layer and network layer (combined)

  • For example…

Networking Overview 10


Layering again l.jpg
Layering (Again)

  • Each layer adds some info

    • Usually added to beginning, so called a header

Networking Overview 11


Terminology l.jpg
Terminology

  • Application layer packet

  • Transport layer  TCP segment (for example)

  • Network layer  IP datagram

  • Data link/physical layer(s)  frame

  • We may use “packet” for all of these

Networking Overview 12


Tcp ip13 l.jpg
TCP/IP

  • Protocols: TCP, UDP, IP, ICMP

    • Defined in RFCs 791 thru 793

  • Developed for academic research

    • No thought of security

    • No confidentiality, integrity, authentication, …

Networking Overview 13


Tcp ip and security l.jpg
TCP/IP and Security

  • Originally, no security in TCP/IP

    • Any security provided by applications

  • But TCP/IP retrofit for security

    • IPSec --- security at the “IP layer”

    • “Built in” security for applications

    • IPSec is a bloated and complex protocol

Networking Overview 14


Slide15 l.jpg
TCP

  • TCP provides reliable delivery

  • Most familiar apps use TCP

    • Web browsing (HTTP)

    • Secure shell (SSH)

    • File transfer (FTP)

    • Email (SMTP, POP, IMAP)

    • Etc., etc., etc.

  • For most apps, TCP saves a lot of work

Networking Overview 15


Tcp header l.jpg
TCP Header

  • Every TCP packet includes header

Networking Overview 16


Tcp port numbers l.jpg
TCP Port Numbers

  • Source port, destination port

    • 16-bit numbers

    • Tells which “door” to send data to

    • Source == outgoing “door”, etc.

  • Server application “listens” on a port

    • Listening ports are open

    • Non-listening ports are closed

Networking Overview 17


Tcp port numbers18 l.jpg
TCP Port Numbers

  • Examples of well-known ports

    • TCP port 21 --- FTP

    • TCP port 22 --- SSH

    • TCP port 23 --- telnet

    • TCP port 25 --- SMTP

    • TCP port 80 --- HTTP

    • TCP port 6000 --- The X Window System (X11)

  • Note these ports are used by convention

    • Could use 8080 for HTTP and not get arrested

    • But both client and server must know this

Networking Overview 18


Ports l.jpg
Ports

  • Example

  • Note that attackers want to know which ports (“doors”) are open

Networking Overview 19


Ports20 l.jpg
Ports

  • To see which ports are in use

    • Locally, use netstat -na

Networking Overview 20


Tcp control bits l.jpg
TCP Control Bits

  • Control bits or flags

  • For “3-way handshake”, and other special things

Networking Overview 21


Tcp control bits22 l.jpg
TCP Control Bits

  • Originally, 6 control bits

    • URG --- urgent data, give it priority (or not…)

    • ACK --- acknowledge earlier data

    • PSH --- push data thru now

    • RST --- reset the connection, due to error or an interruption (abnormal termination)

    • SYN --- synchronize sequence numbers

    • FIN --- no more data, so tear down connection

Networking Overview 22


Tcp control bits23 l.jpg
TCP Control Bits

  • Two additional control bits

    • CWR --- congestion window reduced; due to network congestion, reduced window size

    • ECE --- explicit congestion notification echo; connection is experiencing congestion

  • For congestion control issues

Networking Overview 23


Tcp 3 way handshake l.jpg
TCP 3-Way Handshake

  • Used to establish TCP connection

  • Note sequence numbers: ISNA and ISNB

    • ACK and SYN flag bits used here

Networking Overview 24


Tcp 3 way handshake25 l.jpg
TCP 3-Way Handshake

  • Establishes “connection”

  • Sequence numbers enable TCP to

    • Make sure all packets arrive

    • Make sure all packets delivered in order

  • FIN bit used when session torn down

  • RST used to end in “error” cases

Networking Overview 25


Other fields in tcp header l.jpg
Other Fields in TCP Header

  • Data offset --- where the data begins

  • Reserved --- reserved for future use (or for clever attackers…)

  • Window --- controls number of outstanding packets; prevents one side from sending too fast (flow control)

  • Checksum --- error detection (uses CRC)

Networking Overview 26


Other fields in tcp header27 l.jpg
Other Fields in TCP Header

  • Urgent pointer --- if URG flag set, tells where the urgent data is located

  • Options --- additional info (e.g., the max size of packet); variable size

  • Padding --- used to make things line up on 32-bit boundaries

Networking Overview 27


Slide28 l.jpg
UDP

  • UDP == User Datagram Protocol

  • Minimal “no frills” transport protocol

    • Does minimum possible

    • “Connectionless”

    • No flow control, no congestion control, packets can be out of order, not arrive, …

    • UDP == Unreliable Damn Protocol

Networking Overview 28


Slide29 l.jpg
UDP

  • Why use UDP?

  • Low overhead

    • 8 byte header vs 20 bytes (or more) for TCP

  • No congestion control/flow control

    • How can this be good?

Networking Overview 29


Where is udp used l.jpg
Where is UDP Used?

  • Streaming audio/video

    • Some packet loss is OK

    • Example: Real Player, UDP port 7070

  • Apps where low overhead is useful

    • Trivial FTP (TFTP), UDP port 69

    • Simple Network Management Protocol (SNMP), UDP port 161

Networking Overview 30


Ftp vs udp l.jpg
FTP vs UDP

  • Which is more secure?

  • With UDP, more work for firewalls

    • Hard to track “connections”

    • Example: Slammer worm fit into one 376-byte UDP packet; got thru firewalls

  • But neither TCP nor UDP offer any “real” security (confidentiality, etc.)

Networking Overview 31


Slide32 l.jpg
IP

  • IP == Internet Protocol

    • Not “intellectual property”

  • IP is the network layer protocol today

    • Mostly IPv4

    • IPv6 used a little bit --- offers more addresses and more security

    • Here, we focus on IPv4

Networking Overview 32


Ip header l.jpg
IP Header

  • Note that source and destination addresses each 32 bits

Networking Overview 33


What is a network l.jpg
What is a Network?

  • LAN == Local Area Network

  • LANs are building blocks of networks

  • LAN is bunch of computers connected together by hub, switch, wireless, …

    • No router between computers on a LAN

  • Usually, small geographic area

Networking Overview 34


What is a network35 l.jpg
What is a Network?

  • LANs are connected by routers

    • Routers move packets between LANs

Networking Overview 35


Ip addresses l.jpg
IP Addresses

  • IP addresses are 32 bits

  • Identify hosts (computers) on network

  • Written in “dotted decimal” notation

    • Author calls it “dotted quad” notation

Networking Overview 36


Ip addresses37 l.jpg
IP Addresses

  • Every IP packet has source and destination IP addresses

  • Every IP address has 2 parts

    • One part identifies the network (LAN)

    • One part identifies the specific host

    • Makes routing more efficient

  • But which part is which?

Networking Overview 37


Netmasks l.jpg
Netmasks

  • Leftmost bits are network part of address

  • Netmask (subnet mask) often used

    • Uses “AND” operation

  • Classless Inter-Domain Routing (CIDR) notation

    • 10.21.0.0/16

Networking Overview 38


Packet fragmentation l.jpg
Packet Fragmentation

  • Link may accept packet of max length

  • What if packet is too big?

  • Fragmentation!

    • Router chops packet into pieces

    • Reassembled at destination

    • Fields in IP header identify fragments (and how to reassemble them)

Networking Overview 39


Fragmentation bits l.jpg
Fragmentation Bits

  • Don’t fragment bit

    • 0 == OK to fragment, 1 == don’t fragment

  • More fragments bit

    • 0 == last fragment, 1 == more fragments

  • Fragmentation opens door to attacks

    • Firewalls/IDS do not like fragments

Networking Overview 40


Other stuff in ip header l.jpg
Other Stuff in IP Header

  • Version --- IPv4 or IPv6

  • Hlen --- total length of IP header

  • Service Type --- for quality of service

  • Total Length --- length of data and header

  • Identification --- for fragment reassembly

  • Flags --- don’t fragment, more fragments, …

  • Fragmentation Offset --- how to reassemble fragments

Networking Overview 41


Other stuff in ip header42 l.jpg
Other Stuff in IP Header

  • Time-to-Live (TTL) --- max number of “hops” remaining before packet dies

  • Protocol --- TCP or UDP

  • Header Checksum --- error detection in header (recomputed at each router)

  • Source IP Address --- “from”

  • Destination IP Address --- “to”

  • Options --- e.g., “source routing”

  • Padding --- pad length to multiple of 32 bits

Networking Overview 42


Slide43 l.jpg
ICMP

  • Internet Control Message Protocol

  • Like the “network plumber”

    • Host uses ICMP to see if another host is alive and responding

    • Router uses ICMP to tell source it does not know how to route a packet

    • Host can tell another host to stop sending data so fast, etc., etc.

Networking Overview 43


Slide44 l.jpg
ICMP

  • Same packet format as IP

    • Protocol field is set to 1

  • Many ICMP message types

    • Common types listed on next 2 slides

Networking Overview 44


Slide45 l.jpg
ICMP

  • Name (type number) --- explanation

    • Echo reply (0) --- response to ping

    • Destination unreachable (3) --- IP packet cannot be delivered (sent by router or host)

    • Source quench (4) --- slow down!

    • Redirect (5) --- send data to different router

    • Echo (8) --- ping (is system responding?)

Networking Overview 45


Slide46 l.jpg
ICMP

  • Message, type number, explanation

    • Time Exceeded (11) --- TTL exceeded, or problem reassembling fragments

    • Parameter Problem (12) --- bad parameter

    • Timestamp (13) --- request system’s time

    • Timestamp Reply (14) --- send system time

    • Information Request (15) --- used to determine which network a host is on

    • Information Reply (16) --- network IP address

Networking Overview 46


Routing packets l.jpg
Routing Packets

  • How routers get packets thru network

    • Like Little Red Riding Hood trying to find the best path to grandma’s house

  • Dynamic routing protocols

    • RIP, OSPF, BGP

    • As if trees in the forest calculate best path and tell Red which way to go

Networking Overview 47


Routing packets48 l.jpg
Routing Packets

  • Static routing protocols

    • Hard-coded routes

    • Red always has to go the same way

  • Source routing

    • Source specifies route in packet

    • Step-by-step directions to Grandma’s house tattooed on Red’s forehead

Networking Overview 48


Slide49 l.jpg
NAT

  • Network Address Translation

  • Address-related problems

    • Not enough IP addresses to go around

    • Internal network uses “illegal” or unroutable (private) addresses

  • Solutions: NAT

    • Gateway (i.e., router or firewall) “translates” addresses

Networking Overview 49


Slide50 l.jpg
NAT

  • Outgoing --- gateway replaces internal address with valid IP address

  • Incoming --- gateway replaces valid IP address with internal address

  • Note that gateway must remember!

Networking Overview 50


How to implement nat l.jpg
How to Implement NAT?

  • Map single IP address

    • Every packet mapped to one IP address

    • Vary source port numbers

    • Port Address Translation (PAT)

  • One-to-one mapping

    • Internal address mapped to unique IP address

  • Dynamically allocate addresses

    • Multiplex internal addresses to IP addresses

    • Not as popular as other 2 approaches

Networking Overview 51


Nat and security l.jpg
NAT and Security

  • NAT hides internal IP addresses

    • Might be harder for attacker to map network topology

  • NAT of limited security value

    • Attacker could take over NAT device

    • Attacker could let NAT do its job and attack internal network

    • Some argue NAT harms security (IPSec)

Networking Overview 52


Firewalls pick your analogy l.jpg
Firewalls: Pick Your Analogy

  • Network “traffic cop”

  • Network “soccer goalie”

Networking Overview 53


Firewalls l.jpg
Firewalls

  • Filter based on…

    • Services, addresses, data, etc., etc.

  • May be used to protect…

    • Your network from Internet

    • Your network from partner’s network

    • Your network from your network

    • Internet from your network

Networking Overview 54


Firewalls55 l.jpg
Firewalls

  • Attacker: “kick ball” past goalie…

Networking Overview 55


Firewalls56 l.jpg
Firewalls

  • Three types of firewalls

    • Packet filter (network layer)

    • Stateful packet filter (transport layer)

    • Proxy-based firewall (application layer)

  • All firewalls one of these types

    • In spite of marketing…

  • Also, Intrusion Prevention Systems (IPS)

    • Not quite the same as firewall

Networking Overview 56


Packet filter l.jpg
Packet Filter

  • Filter each packet individually

    • No concept of state

  • Can filter based on…

    • Source/destination IP address

    • Source/destination port (application specific)

    • TCP control bits (SYN, ACK, etc.)

    • Protocol (e.g., allow TCP, deny UDP)

    • Direction (incoming, outgoing)

    • Interface (trusted or untrusted network)

Networking Overview 57


Packet filter58 l.jpg
Packet Filter

  • Access control list (ACL), e.g.,

Flag

Bits

Source

IP

Dest

IP

Source

Port

Dest

Port

Action

Protocol

  • Start at top and work down the list

    • What do 1st, 2nd, 3rd lines do?

Networking Overview 58


Packet filter59 l.jpg
Packet Filter

  • Disadvantage: very limited view

  • Consider ACL on previous slide

    • Easy to kick ball past this goalie

    • E.g., ACK scan

  • Even worse with UDP

    • No flag bits

  • Advantages: speed and simplicity

Networking Overview 59


Stateful packet filter l.jpg
Stateful Packet Filter

  • Improve packet filter by adding state

    • State == remember something (packets)

  • Remember each active connection

    • State table: info on active connections

    • Time out, typically, after 10 to 90 seconds

    • Can see how/if new packet fits into ongoing connection

    • For example, ACK must be preceeded by SYN

Networking Overview 60


Stateful packet filter61 l.jpg
Stateful Packet Filter

  • With packet filter

    • Attacker can “ACK scan” for open ports

    • Send ACK packets with no prior SYN

  • With stateful packet filter

    • ACK scan fails

    • Packets dropped since no prior SYN

  • Can also remember UDP “connections”

Networking Overview 61


Stateful packet filter62 l.jpg
Stateful Packet Filter

  • Advantage: Much stronger than packet filter

  • Disadvantage: More work

    • Often implemented in custom hardware, so speeds can be competitive

  • Still lacks a complete view…

Networking Overview 62


Proxy l.jpg
Proxy

  • Proxy --- acts on your behalf

  • Analogy…

    • Student calls me at home late at night

    • My wife answers the phone

    • She tells me a student called

    • Me: “Tell that $&^# to get lost!”

    • My wife: “He’s busy, can I take a msg?”

Networking Overview 63


Proxy64 l.jpg
Proxy

  • Another analogy…

    • Telemarketer calls me at home

    • My wife answers the phone

    • She tells them to go away…

    • …without informing me of the call

  • My wife is acting as my proxy

  • Proxy firewall is similar

Networking Overview 64


Proxy based firewall l.jpg
Proxy-Based Firewall

  • Proxy can look at complete picture

    • Everything packet filter sees

    • Everything stateful packet filter sees

    • Plus application level info --- can verify that protocols are followed, data is free of malware, etc., etc.

  • May cache info for efficiency

Networking Overview 65


Proxy based firewall66 l.jpg
Proxy-Based Firewall

  • Advantage: complete view

  • Disadvantage: speed, computing power

    • May limit amount of traffic it can handle, more expensive hardware, more complex, etc.

Networking Overview 66


Slide67 l.jpg
IPS

  • Intrusion Prevention System (IPS)

    • Similar to, but not quite a firewall

  • Analyze network traffic in real time

  • Attack signatures/suspicious behavior

    • Signatures/anomaly detection

  • Firewall does not do this

  • Can block suspicious communications

Networking Overview 67


Best firewall l.jpg
Best Firewall?

  • Try to get best from each technology

Networking Overview 68


Data link layer l.jpg
Data Link Layer

  • Not part of TCP/IP

    • But it is a source of attacks

  • Data Link Layer

    • Move packets across one “hop”, LAN to router, router to router, etc.

    • Lives in Network Interface Card (NIC)

    • Ethernet, 802.11 (wireless), etc.

Networking Overview 69


Ethernet l.jpg
Ethernet

  • Ethernet is “king of the Link Layer”

  • Ethernet used on shared media

    • Resource contention

  • Media Access Control (MAC) addresses

    • 48 bits, globally unique

    • Of form AA:BB:CC:DD:EE:FF (or “.” for “:”)

    • IP address is like street address, MAC address like social security number

    • Aside: Why not use IP address for everything?

Networking Overview 70


Slide71 l.jpg
ARP

  • Address Resolution Protocol (ARP)

    • MAC address for LAN, IP address for network

  • ARP is used to find MAC address, given the IP address

    • Broadcast IP address

    • Whoever has it, responds with MAC address

    • Response is cached (for efficiency)

Networking Overview 71


Slide72 l.jpg
ARP

  • ARP only applies on same LAN

  • ARP is stateless

Networking Overview 72


Hubs and switches l.jpg
Hubs and Switches

  • Both used on LAN

  • Hub is simple/dumb device

    • Broadcast to all interfaces

    • Simple, but wastes bandwidth

  • Switch is smarter

    • Only sends data to a specific interface

    • Reduces bandwidth usage

Networking Overview 73


Hubs and switches74 l.jpg
Hubs and Switches

  • Hub

    • Simple

    • Wasteful

  • Switch

    • Complex

    • Saves bandwidth

Networking Overview 74


Switches l.jpg
Switches

  • Switch stores MAC address locations

    • Content Addressable Memory (CAM)

  • Table determined automatically

    • At first switch acts like hub

    • Then looks at MAC addresses

    • Uses this info to fill in table

    • This all happens automatically

Networking Overview 75


Switch l.jpg
Switch

Networking Overview 76


Wireless lan l.jpg
Wireless LAN

  • 802.11 is king of WLAN

  • Wireless security is difficult

    • Often not secured, rogue access points, …

  • LAN usually has little or no security

    • Maybe OK if physical access required

    • But WLAN changes all of that…

    • WLAN is good news for Trudy and Eve

Networking Overview 77


Slide78 l.jpg
WLAN

  • Regular LAN attacks work on WLAN

  • Physical access not required!

  • Makes hackable network more so

  • Great news for Trudy and Eve!

    • Cell phones and other wireless technology promise even more hacks

Networking Overview 78


802 11 l.jpg
802.11

  • 802.11 --- 1997 @ 2Mbps

  • 802.11a --- 1999 @ 54Mbps

    • Not used much, since came out at same time as 802.11b, and 802.11b is cheaper

  • 802.11b --- 1999 @ 11Mbps

    • Speed similar to traditional Ethernet

  • 802.11g --- 2003 @ 54Mbps

    • Popular, combines best of 802.11a and 802.11b

Networking Overview 79


802 1180 l.jpg
802.11

  • 802.11i --- 2004

    • Real security

    • Strong encryption (AES)

    • Strong key exchange (TKIP)

  • Much stronger than WEP

    • WEP: “swiss cheese” of security protocols

    • WEP: no integrity, poor encryption, etc.

Networking Overview 80


Slide81 l.jpg
WEP

  • According to Tanenbaum:

    • “The 802.11 standard prescribes a data link-level security protocol called WEP (Wired Equivalent Privacy), which is designed to make the security of a wireless LAN as good as that of a wired LAN. Since the default for a wired LAN is no security at all, this goal is easy to achieve, and WEP achieves it as we shall see.”

Networking Overview 81


Security on the internet l.jpg
Security on the Internet

  • TCP/IP provides no security

  • Must retrofit Internet for security

  • Application layer

    • PGP, S/MIME, SSH, …

  • “Socket layer”

    • SSL/TLS (really part of application layer)

  • Network layer

    • IPSec

Networking Overview 82


Application layer security l.jpg
Application Layer Security

  • Pretty Good Privacy (PGP)

    • Developed by Phil Zimmerman

    • No backdoor?

      • “We don’t hire that kind of person”

  • Secure/Multipurpose Internet Mail Extensions (S/MIME)

    • Secure email

  • Secure Shell (SSH)

    • Secure “tunnel” for remote access

Networking Overview 83


Slide84 l.jpg
SSL

  • Secure Socket Layer (SSL)

    • Developed for Web, HTTP

    • Can be used anywhere

    • Elegant security protocol

  • Transport Layer Security (TLS)

    • Same, but incompatible

Networking Overview 84


Slide85 l.jpg
SSL

  • Authentication, confidentiality, integrity

  • You use SSL all the time

    • Whenever “lock” (or “key”) appears in browser

    • HTTPS == HTTP with SSL

  • Secure transactions on Internet

Networking Overview 85


Slide86 l.jpg
SSL

  • Not quite the same as in CS166 or CS265…

Networking Overview 86


Slide87 l.jpg
SSL

Networking Overview 87


A note on notation l.jpg
A Note on Notation

  • E(X,K) == encrypt X with symmetric key K

    • Key is known to sender and receiver

    • And nobody else

  • {X}Alice == encrypt X with Alice’s public key

    • Key know to everybody

    • Can only be decrypted with Alice’s private key

    • Alice’s private key known only to Alice

Networking Overview 88


Notation l.jpg
Notation

  • h(X) == cryptographic hash function

    • Provides “fingerprint” of X

    • Compresses data

  • Certificate

    • Contains (at least) public key, name

    • Signed by a Certificate Authority (CA)

    • CA vouches that corresponding private key belongs to “name” in certificate

    • Anyone can verify signature (public key)

Networking Overview 89


Simple ssl like protocol l.jpg
Simple SSL-like Protocol

  • Is Alice sure she’s talking to Bob?

  • Is Bob sure he’s talking to Alice?

I’d like to talk to you securely

Here’s my certificate

{KAB}Bob

protected HTTP

Bob

Alice

Networking Overview 90


Simplified ssl protocol l.jpg
Simplified SSL Protocol

Can we talk?, cipher list, RA

  • S is pre-master secret

  • K = h(S,RA,RB)

  • msgs = all previous messages

  • CLNT and SRVR are constants

certificate, cipher, RB

{S}Bob, E(h(msgs,CLNT,K),K)

h(msgs,SRVR,K)

Data protected with key K

Bob

Alice

Networking Overview 91


Ssl authentication l.jpg
SSL Authentication

  • Alice authenticates Bob, not vice-versa

    • How does client authenticate server?

    • Why does server not authenticate client?

  • Mutual authentication is possible: Bob sends certificate request in message 2

    • This requires client to have certificate

    • If server wants to authenticate client, server could instead require (encrypted) password

Networking Overview 92


Ssl mim attack l.jpg
SSL MiM Attack

RA

RA

  • Q: What prevents this MiM attack?

  • A: Bob’s certificate must be signed by a certificate authority (such as Verisign)

  • What does browser do if signature not valid?

  • What does user do if signature is not valid?

certificateT, RB

certificateB, RB

{S1}Trudy,E(X1,K1)

{S2}Bob,E(X2,K2)

h(Y1,K1)

h(Y2,K2)

Trudy

E(data,K1)

E(data,K2)

Alice

Bob

Networking Overview 93


Ssl vs ipsec l.jpg
SSL vs IPSec

  • IPSec  discussed next

    • Lives at the network layer (part of the OS)

    • Has encryption, integrity, authentication, etc.

    • Is overly complex (including serious flaws)

  • SSL (and IEEE standard known as TLS)

    • Lives at socket layer (part of user space)

    • Has encryption, integrity, authentication, etc.

    • Has a simpler specification

Networking Overview 94


Ssl vs ipsec95 l.jpg
SSL vs IPSec

  • IPSec implementation

    • Requires changes to OS, but no changes to applications

  • SSL implementation

    • Requires changes to applications, but no changes to OS

  • SSL built into Web application early on (Netscape)

  • IPSec used in VPN applications (secure tunnel)

  • Reluctance to retrofit applications for SSL

  • Reluctance to use IPSec due to complexity and interoperability issues

  • Result? Internet less secure than it should be!

Networking Overview 95


Ipsec l.jpg
IPSec

Networking Overview 96


Ipsec and ssl l.jpg

application

transport

network

link

physical

IPSec and SSL

  • IPSec lives at the network layer

  • IPSec is transparent to applications

User

SSL

OS

IPSec

NIC

Networking Overview 97


Ipsec and complexity l.jpg
IPSec and Complexity

  • IPSec is a complex protocol

  • Over-engineered

    • Lots of generally useless extra features

  • Flawed

    • Some significant security issues

  • Interoperability is serious challenge

    • Defeats the purpose of having a standard!

  • Complex

  • Did I mention, it’s complex?

Networking Overview 98


Ike and esp ah l.jpg
IKE and ESP/AH

  • Two parts to IPSec

  • IKE: Internet Key Exchange

    • Mutual authentication

    • Establish shared symmetric key

    • Two “phases”  like SSL session/connection

  • ESP/AH

    • ESP: Encapsulating Security Payload  for encryption and/or integrity of IP packets

    • AH: Authentication Header  integrity only

Networking Overview 99


Slide100 l.jpg
IKE

Networking Overview 100


Slide101 l.jpg
IKE

  • IKE has 2 phases

    • Phase 1  IKE security association (SA)

    • Phase 2  AH/ESP security association

  • Phase 1 is comparable to SSL session

  • Phase 2 is comparable to SSL connection

  • Not an obvious need for two phases in IKE

  • If multiple Phase 2’s do not occur, then it is more expensive to have two phases!

Networking Overview 101


Ike phase 1 l.jpg
IKE Phase 1

  • Four different “key” options

    • Public key encryption (original version)

    • Public key encryption (improved version)

    • Public key signature

    • Symmetric key

  • For each of these, two different “modes”

    • Main mode

    • Aggressive mode

  • There are 8 versions of IKE Phase 1!

  • Evidence that IPSec is over-engineered?

Networking Overview 102


Ike phase 1103 l.jpg
IKE Phase 1

  • We discuss 1 of 8 phase 1 variants

    • Public key signatures

    • Both main and aggressive modes

Networking Overview 103


Ike phase 1104 l.jpg
IKE Phase 1

  • Uses ephemeral Diffie-Hellman to establish session key

    • Provides perfect forward secrecy (PFS)

  • Let a be Alice’s Diffie-Hellman exponent

  • Let b be Bob’s Diffie-Hellman exponent

  • Let g be generator and p prime

  • Recall that p and g are public

Networking Overview 104


Ike phase 1 digital signature main mode l.jpg
IKE Phase 1: Digital Signature (Main Mode)

IC, CP

IC,RC, CS

  • CP = crypto proposed, CS = crypto selected

  • IC = initiator “cookie”, RC = responder “cookie”

  • K = h(IC,RC,gab mod p,RA,RB)

  • SKEYID = h(RA, RB, gab mod p)

  • proofA = [h(SKEYID,ga,gb,IC,RC,CP,“Alice”)]Alice

IC,RC, ga mod p, RA

IC,RC, gb mod p, RB

IC,RC, E(“Alice”, proofA, K)

Alice

Bob

IC,RC, E(“Bob”, proofB, K)

Networking Overview 105


Ike phase 1 public key signature aggressive mode l.jpg
IKE Phase 1: Public Key Signature (Aggressive Mode)

IC, “Alice”, ga mod p, RA,CP

  • Main difference from main mode

    • Not trying to protect identities

    • Cannot negotiate g or p

IC,RC, “Bob”, RB,

gb mod p, CS, proofB

IC,RC, proofA

Bob

Alice

Networking Overview 106


Main vs aggressive modes l.jpg
Main vs Aggressive Modes

  • Main mode MUST be implemented

  • Aggressive mode SHOULD be implemented

    • In other words, if aggressive mode is not implemented, “you should feel guilty about it”

  • Might create interoperability issues

  • For public key signature authentication

    • Passive attacker knows identities of Alice and Bob in aggressive mode

    • Active attacker can determine Alice’s and Bob’s identity in main mode

Networking Overview 107


Ipsec108 l.jpg
IPSec

  • After IKE Phase 1, we have an IKE SA

  • After IKE Phase 2, we have an IPSec SA

  • Both sides have a shared symmetric key

  • Now what?

    • We want to protect IP datagrams

  • But what is an IP datagram?

    • From the perspective of IPSec…

Networking Overview 108


Ip review l.jpg
IP Review

  • IP datagram is of the form

  • Where IP header is

data

IP header

Networking Overview 109


Ip and tcp l.jpg
IP and TCP

  • Consider HTTP traffic (over TCP)

  • IP encapsulates TCP

  • TCP encapsulates HTTP

data

IP header

IP header

TCP hdr

HTTP hdr

app data

  • IPdata includes TCP header, etc.

Networking Overview 110


Ah vs esp l.jpg
AH vs ESP

  • AH

    • Authentication Header

    • Integrityonly (no confidentiality)

    • Integrity-protect everything beyond IP header and some fields of header (why not all fields?)

  • ESP

    • Encapsulating Security Payload

    • Integrity and confidentiality

    • Protects everything beyond IP header

    • Integrity-only by using NULL encryption

Networking Overview 111


Esp s null encryption l.jpg
ESP’s NULL Encryption

  • According to RFC 2410

    • NULL encryption “is a block cipher the origins of which appear to be lost in antiquity”

    • “Despite rumors”, there is no evidence that NSA “suppressed publication of this algorithm”

    • Evidence suggests it was developed in Roman times as exportable version of Caesar’s cipher

    • Can make use of keys of varying length

    • No IV is required

    • Null(P,K) = P for any P and any key K

  • Security people have a strange sense of humor!

Networking Overview 112


Why does ah exist 1 l.jpg
Why Does AH Exist? (1)

  • Cannot encrypt IP header

    • Routers must look at the IP header

    • IP addresses, TTL, etc.

    • IP header exists to route packets!

  • AH protects immutable fields in IP header

    • Cannot integrity protect all header fields

    • TTL, for example, must change

  • ESP does not protect IP header at all

Networking Overview 113


Why does ah exist 2 l.jpg
Why Does AH Exist? (2)

  • ESP encrypts everything beyond the IP header (if non-null encryption)

  • If ESP encrypts, firewall cannot look at TCP header (e.g., port numbers)

  • Why not use ESP with null encryption?

    • Firewall sees ESP header, but does not know whether null encryption is used

    • End systems know, but not firewalls

  • Aside 1: Do firewalls reduce security?

  • Aside 2: Is IPSec compatible with NAT?

Networking Overview 114


Why does ah exist 3 l.jpg
Why Does AH Exist? (3)

  • The real reason why AH exists

    • At one IETF meeting “someone from Microsoft gave an impassioned speech about how AH was useless…”

    • “…everyone in the room looked around and said `Hmm. He’s right, and we hate AH also, but if it annoys Microsoft let’s leave it in since we hate Microsoft more than we hate AH.”

Networking Overview 115


Ipsec116 l.jpg
IPSec

  • Will it save us?

    • According to the author: “No!”

  • Even if universally implemented, many problems remain

    • E.g., software (need I say more?)

  • But it is step in the right direction

Networking Overview 116


Kerberos l.jpg
Kerberos

Networking Overview 117


Kerberos118 l.jpg
Kerberos

  • In Greek mythology, Kerberos is 3-headed dog that guards entrance to Hades

    • “Wouldn’t it make more sense to guard the exit?”

  • In security, Kerberos is an authentication system based on symmetric key crypto

    • Originated at MIT

    • Based on work by Needham and Schroeder

    • Relies on a trusted third party (TTP)

Networking Overview 118


Motivation for kerberos l.jpg
Motivation for Kerberos

  • Authentication using public keys

    • N users N key pairs

  • Authentication using symmetric keys

    • N users requires about N2 keys

  • Symmetric key case does not scale!

  • Kerberos based on symmetric keys but only requires N keys for N users

    • But must rely on TTP

    • Advantage is that no PKI is required

Networking Overview 119


Kerberos kdc l.jpg
Kerberos KDC

  • Kerberos Key Distribution Center or KDC

    • Acts as a TTP

    • TTP must not be compromised!

    • KDC shares symmetric key KA with Alice, key KB with Bob, key KC with Carol, etc.

    • Master key KKDC known only to KDC

    • KDC enables authentication and session keys

    • Keys for confidentiality and integrity

    • In practice, the crypto algorithm used is DES

Networking Overview 120


Kerberos tickets l.jpg
Kerberos Tickets

  • KDC issues a ticket containing info needed to access a network resource

  • KDC also issues ticket-granting tickets or TGTs that are used to obtain tickets

  • Each TGT contains

    • Session key

    • User’s ID

    • Expiration time

  • Every TGT is encrypted with KKDC

    • TGT can only be read by the KDC

Networking Overview 121


Kerberized login l.jpg
Kerberized Login

  • Alice enters her password…

  • …then Alice’s workstation

    • Derives KA from Alice’s password

    • Uses KA to get TGT for Alice from the KDC

  • Alice can then use her TGT (credentials) to securely access network resources

  • Plus: Security is transparent to Alice

  • Minus: KDC must be secure  it’s trusted!

Networking Overview 122


Kerberized login123 l.jpg
Kerberized Login

Alice wants

  • Key KA derived from Alice’s password

  • KDC creates session key SA

  • Workstation decrypts SA, TGT, forgets KA

  • TGT = E(“Alice”,SA, KKDC)

Alice’s

a TGT

password

E(SA,TGT,KA)

Computer

KDC

Alice

Networking Overview 123


Alice requests ticket to bob l.jpg
Alice Requests Ticket to Bob

I want to

talk to Bob

  • REQUEST = (TGT, authenticator) where

    authenticator = E(timestamp,SA)

  • REPLY = E(“Bob”,KAB,ticket to Bob, SA)

  • ticket to Bob = E(“Alice”,KAB,KB)

  • KDC gets SA from TGT to verify timestamp

REQUEST

Talk to Bob

REPLY

Computer

Alice

KDC

Networking Overview 124


Alice uses ticket to bob l.jpg
Alice Uses Ticket to Bob

  • ticket to Bob = E(“Alice”,KAB, KB)

  • authenticator = E(timestamp, KAB)

  • Bob decrypts “ticket to Bob” to get KAB which he then uses to verify timestamp

ticket to Bob, authenticator

E(timestamp + 1,KAB)

Bob

Alice’s

Computer

Networking Overview 125


Kerberos126 l.jpg
Kerberos

  • Session key SA used for authentication

  • Can also be used for confidentiality/integrity

  • Timestamps used for mutual authentication

  • Recall that timestamps reduce number of messages

    • Acts like a nonce that is known to both sides

    • Note: time is a security-critical parameter!

Networking Overview 126


Kerberos questions l.jpg
Kerberos Questions

  • When Alice logs in, KDC sends E(SA,TGT,KA)whereTGT = E(“Alice”,SA,KKDC)

    Q: Why is TGT encrypted with KA?

    A: Extra work and no added security!

  • In Alice’s Kerberized login to Bob, why can Alice remain anonymous?

  • Why is “ticket to Bob” sent to Alice?

  • Where is replay prevention in Kerberos?

Networking Overview 127


Kerberos alternatives l.jpg
Kerberos Alternatives

  • Could have Alice’s workstation remember password and use that for authentication

    • Then no KDC required

    • But hard to protect password on workstation

    • Scaling problem

  • Could have KDC remember session key instead of putting it in a TGT

    • Then no need for TGTs

    • But stateless KDC is big feature of Kerberos

Networking Overview 128


Kerberos keys l.jpg
Kerberos Keys

  • In Kerberos, KA = h(Alice’s password)

  • Could instead generate random KA and

    • Compute Kh = h(Alice’s password)

    • And workstation stores E(KA, Kh)

  • Then KA need not change (on workstation or KDC) when Alice changes her password

  • But E(KA, Kh) subject to password guessing

  • This alternative approach is often used in applications (but not in Kerberos)

Networking Overview 129


Kerberos issues l.jpg
Kerberos Issues?

  • What if…

  • Trudy gets Alice’s “credentials”?

    • No problem!

    • Credentials encrypted with KKDC

  • Trudy breaks into Alice’s machine?

    • Session key SA is cached

    • This breaks authentication

Networking Overview 130


Conclusion l.jpg
Conclusion

  • TCP/IP very flexible

  • TCP/IP not designed for security

    • Highly hackable

  • SSL, IPSec, etc., help

    • But many problems remain

Networking Overview 131


Summary l.jpg
Summary

  • TCP/IP, OSI Ref. Model, Layers, …

  • Protocols: TCP, UDP, IP, ICMP

  • Ports, well-known ports

  • TCP flags/control bits

  • 3-way handshake

  • Unreliable Damn Protocol

Networking Overview 132


Summary133 l.jpg
Summary

  • IP, IP addresses, fragments, etc.

  • ICMP, “plumbing”

  • Routing, NAT, Firewalls

  • Ethernet, hub, switch, MAC address, ARP

  • WLAN and 802.11

  • PGP, SSH, S/MIME

  • SSL and IPSec

Networking Overview 133


ad