INF672/ACN910 Protocol Safety and Verification

Size: px
Start display at page:

Download "INF672/ACN910 Protocol Safety and Verification"

Transcription

1 INF672/ACN910 Protocol Safety and Verification Karthik Bhargavan Xavier Rival Thomas Clausen 1

2 Networking Formal Verification Routers, endpoints, protocol stacks Models, programs, automated analysis Concerns: Speed (latency, b/w) Interoperability Fault-tolerance Preventing Attacks Concerns: Termination Crash-freedom Correctness/finding bugs Security theorem This course: Can we use formal verification to build more robust protocols?

3 Course Outline Lecture 1 [Today, Sep 15] Introduction, Motivating Examples Lectures 2-4 [Sep 22,29, Oct 6] Network Protocol Verification: Spin Lectures 5-8 [Oct 13, 20, 27, Nov 3] Program Verification: Properties, Tools & Techniques Lecture 9 [Nov 10] Security Protocol Verification: ProVerif Lecture 10 [Nov 17] Exam

4 Readings No textbook: Slides will be available on moodle after lecture Research Papers: Each lecture will cite several research papers; reading them is optional but recommended. (Learning to read such papers is one of the objectives of the course) Verification Tools: Some lectures will describe verification tools. Downloading tools and reading manuals is expected Similar master-level courses elsewhere: Princeton: cos598d/formalmethodsnetworkingoutline.html University of Pennsylvania:

5 Network Protocols In this course, we will study network protocols Their goals, specifications, and implementations Network protocols are distributed programs Execute concurrently on multiple hosts Have complex state machines, subtle corner cases Must account for temporary/permanent failures Wire behavior is usually well specified in standards State machines, protocol goals often left underspecified How do we ensure that a protocol (and its implementation) achieves its intended goals?

6 Formal Protocol Analysis How do we ensure that a protocol (and its implementation) achieves its intended goals? Can we formally state a correctness theorem? Can we (semi-)automatically prove such theorems? Can we (semi-)automatically find counterexamples? Automation is often necessary There are too many cases to consider by hand Proofs and counterexamples should be reproducible

7 Formal Methods Formal languages for modeling protocol execution Communicating Finite State Machines, Pi Calculus, Programs Formal languages for specifying their goals Abstract Protocols, Temporal Logic, Safety Assertions First-order Logic, Higher-order Logic Verifying that a protocol meets its goals Model Checking, Constraint (SAT) Solving, Theorem Proving Verifying that an implementation meets its goals Static Analysis, Type Checking, Program Synthesis

8 Goals Learn how to model and specify protocols Learn how to use verification tools Be able to state and prove theorems about important protocols and their implementations Or find counterexamples/attacks Today: Motivating case studies Specifying and analyzing popular Internet protocols

9

10 HTTP TLS TCP IP

11 Protocol Layers HTTP TLS TCP IP Hypertext Transfer Protocol (HTTP) Standards (v1.1): IETF RFC Goal: Retrieving resources from URIs Transport Layer Security (TLS) Standards (v1.2): IETF RFC 5246 Goal: Secure communication channel Transmission Control Protocol (TCP) Standards: IETF RFC 793 Goal: Reliable data streams Internet Protocol (IP) Standards: IETF RFC 791 Goal: Packet forwarding Paths computed by various routing protocols: BGP, OSPF, IS-IS, AODV,

12 Protocol Goals HTTP TLS TCP IP Each protocol uses an API provided by the lower-layer and provides an API to the higher-layer For each API, we can specify both local and global goals API provided by IP at host H: send : (dstip,data) -> void recv : void -> (srcip,data) (All functions can return errors) Exercise: What are the goals?

13 Many Kinds of Properties Safety: protocol does not do bad things e.g. no runtime error, no incorrect messages Liveness: eventually, something good happens e.g. termination, message delivery Security: no illegal information flows e.g. confidentiality, integrity, authenticity Availability: don t exhaust available resources e.g. denial-of-service, out-of-memory Some properties matter more than others: e.g. security leak > crash > denial-of-service

14 IP Goals TCP IP API provided by IP at host H: send : (dstip,data) -> void recv : void -> (srcip,data) Exercise: What are the goals? Goal: Correct Delivery (Safety) If host H calls recv and gets (H,D) then host H must have called send(h,d) Assumption: Unreliable network Packets may be silently dropped But packets will not be tampered with

15 TCP/IP Goals TCP IP At each TCP/IP host with address H: connect: (dstip,dstport) -> (srcport,handle) accept: dstport -> (srcip,srcport,handle) send: (handle,data) -> void handle -> data close: handle -> void Exercise: What are the guarantees? Goal: Local Invariants (Safety): If application calls send before connect, or if it calls send after close, then send must return an error

16 TCP/IP Goals TCP IP At each TCP/IP host with address H: connect: (dstip,dstport) -> (srcport,handle) accept: dstport -> (srcip,srcport,handle) send: (handle,data) -> void handle -> data Exercise: What are the guarantees? Goal: Reliable Delivery (Liveness): Suppose H calls connect(h,p ) and gets (P,h) Suppose H calls accept(p ) and gets (H,P,h ) Suppose H then calls send(h,d) Suppose H then repeatedly calls recv(h ) Then eventually recv(h ) will return D Assumption: Connected Network (Fairness) IP delivers at least 1 in n packets from H to H

17 Formally Specifying TCP Abstractly, client and server are communicating state machines linked by a lossy channel (IP) To state a theorem, we need a formal semantics with a concurrent execution model and channel-based communication Protocol not really finite state (unbounded data). So, most verification questions are undecidable Concretely, many many details in the standard and its implementations Congestion control, timeouts, packet formats, Typically implemented in C with aggressive optimizations and pointer arithmetic

18 What Is This? This graph shows an approximation to the Host Transition System of the TCP specification TCP: an approximation to the real state diagram close_8 close()) send: LISTEN shutdown_1 deliver_in_1b deliver_in_7b shutdown() r R send: Rs send: send: bad recv segment NONEXIST close_7 close_7 close_8 deliver_in_1 close() close() close() ars send: ArSf send: send: send: there is another socket in state LISTEN states on the incomplete connection queue deliver_in_2 ars send: ArSf TCP, UDP, and Sockets: rigorous and experimentallyvalidated behavioural specification. Volume 1: Overview. Volume 2: The Specification. Steven Bishop, Matthew Fairbairn, Michael Norrish, Peter Sewell, Michael Smith, and Keith Wansbrough The states are the classic TCP states, though note that these are only a tiny part of the protocol endpoint state, in the specification or in implementations. The transitions are an over-approximation to the set of all the transitions in the model which (1) affect the TCP state of a socket, and/or (2) involve processing segments from the host s input queue or adding them to its output queue, except that transitions involving ICMPs are omitted, as are transitions arising from the pathological BSD behaviour in which arbitrary sockets can be moved to LISTEN states. Transitions are labelled by their Host LTS rule name (e.g. socket 1, deliver in 3, etc.), any socket call involved (e.g. close()), and constraints on the flags of any TCP segment received and sent, with e.g. R indicating that RST is set and r indicating RST is clear. Transitions involving segments (either inbound or outbound) with RST set are coloured orange; others that have SYN set are coloured green; others that have FIN set are coloured blue; others are coloured black. The FIN indication includes the case of FINs that are constructed by reassembly rather than appearing in a literal segment. The graph is based on data extracted manually from the HOL specification. The data does not capture all the invariants of the model, so some depicted transitions may not be reachable in the model (or in practice). Similarly, the constraints on flags shown may be overly weak. SYN_SENT connect_4 deliver_in_2a deliver_in_7c deliver_out_1 deliver_out_1 timer_tt_rexmtsyn_1 timer_tt_keep_1 r R send: send: Rs send: send: rsf send: rsf send: arsf send: Arsf bad recv segment close_8 close() send: ARs states on the complete connection queue SYN_RECEIVED deliver_in_3c deliver_in_8 deliver_out_1 deliver_out_1 timer_tt_rexmt_1 timer_tt_persist_1 timer_tt_keep_1 A rs send: Rs send: ARs send: rsf send: rsf send: ArSf send: Arsf send: Arsf stupid ack, or LAND DoS close 3 close 7 close 8 Transition Rules Successful abortive close of a synchronised socket Successfully close the last file descriptor for a socket in the CLOSED, SYN SENT or SYN RECEIVED states. Successfully close the last file descriptor for a listening TCP socket listen_1 listen() send: timer_tt_conn_est_1 send: connect_1 connect()) send: arsf connect_4 send: deliver_in_2 deliver_in_2 deliver_in_2 deliver_in_3 ars ArS ArS rf send: ArSf send: Ars send: Ars send: di3out deliver_in_2 ArS send: Ars deliver_in_7d timer_tt_rexmtsyn_1 AR send: send: except on WinXP maxrxtshift reached CLOSE_WAIT deliver_in_3 deliver_in_3 deliver_in_8 deliver_out_1 timer_tt_persist_1 timer_tt_keep_1 rf rf rs send: di3out send: di3out send: ARs send: rsf send: Arsf send: Arsf deliver_in_2 ArS send: Ars ESTABLISHED FIN_WAIT_1 deliver_in_3 deliver_in_8 deliver_out_1 rf rs send: di3out send: ARs send: rsf deliver_in_3 deliver_out_1 timer_tt_rexmt_1 timer_tt_persist_1 rf send: di3out send: rsf send: ArsF send: ArsF deliver_in_3 rf send: di3out timer_tt_rexmt_1 timer_tt_persist_1 timer_tt_keep_1 deliver_in_3 rf send: Arsf send: Arsf send: Arsf send: di3out connect_1 deliver_in_2 connect()) ArS send: Ars send: arsf deliver_in_3 rf send: di3out deliver_in_3 deliver_in_8 deliver_out_1 deliver_out_1 timer_tt_rexmt_1 timer_tt_keep_1 rf rs send: di3out send: ARs send: rsf send: rsf send: Arsf send: Arsf deliver_in_3 rf send: di3out CLOSING timer_tt_rexmt_1 send: ARs maxrxtshift reached deliver_in_3 deliver_in_3 deliver_in_8 deliver_out_1 deliver_out_1 timer_tt_rexmt_1 timer_tt_keep_1 rf rf rs send: di3out send: di3out send: ARs send: rsf send: rsf send: Arsf send: Arsf deliver_in_7a R send: close_7 close() send: socket_1 socket() send: connect 1 Begin connection establishment by creating a SYN and trying to enqueue it on host s outqueue connect 4 Fail: socket has pending error deliver in 1 Passive open: receive SYN, send SYN,ACK deliver in 1b For a listening socket, receive and drop a bad datagram and either generate a RST segment or ignore it. Drop the incoming segment if the socket s queue of incomplete connections is full. deliver in 2 Completion of active open (in SYN SENT receive SYN,ACK and send ACK) or simultaneous open (in SYN SENT receive SYN and send SYN,ACK) deliver in 2a Receive bad or boring datagram and RST or ignore for SYN SENT socket deliver in 3 Receive data, FINs, and ACKs in a connected state deliver in 3b Receive data after process has gone away deliver in 3c Receive stupid ACK or LAND DoS in SYN RECEIVED state deliver in 6 Receive and drop (silently) a sane segment that matches a CLOSED socket deliver in 7 Receive RST and zap non-{closed; LISTEN; SYN SENT; SYN RECEIVED; TIME WAIT} socket deliver in 7a Receive RST and zap SYN RECEIVED socket deliver in 7b Receive RST and ignore for LISTEN socket deliver in 7c Receive RST and ignore for SYN SENT(unacceptable ack) or TIME WAIT socket deliver in 7d Receive RST and zap SYN SENT(acceptable ack) socket deliver in 8 Receive SYN in non-{closed; LISTEN; SYN SENT; TIME WAIT} state deliver in 9 Receive SYN in TIME WAIT state if there is no matching LISTEN socket or sequence number has not increased deliver out 1 Common case TCP output listen 1 Successfully put socket in LISTEN state listen 1c Successfully put socket in the LISTEN state from any non- {CLOSED; LISTEN} state on FreeBSD shutdown 1 Shut down read or write half of TCP connection socket 1 Successfully return a new file descriptor for a fresh socket timer tt 2msl 1 2*MSL timer expires timer tt conn est 1 connection establishment timer expires timer tt fin wait 2 1FIN WAIT 2 timer expires timer tt keep 1 keepalive timer expires timer tt persist 1 persist timer expires timer tt rexmt 1 retransmit timer expires timer tt rexmtsyn 1 SYN retransmit timer expires LAST_ACK deliver_in_7 R send: deliver_out_1 timer_tt_persist_1 send: rsf send: ArsF close_3 deliver_in_7 close() R send: send: ARs deliver_in_3 deliver_in_8 deliver_out_1 deliver_out_1 timer_tt_rexmt_1 timer_tt_keep_1 rf rs send: di3out send: ARs send: rsf send: rsf send: Arsf send: Arsf close_3 deliver_in_3b deliver_in_7 timer_tt_rexmt_1 deliver_in_3 close() rs R rf send: Rs send: send: ARs send: di3out send: ARs process gone away maxrxtshift reached timer_tt_rexmt_1 send: ARs maxrxtshift reached close_3 close() send: ARs deliver_in_3b rs send: Rs process gone away CLOSED deliver_in_7 R send: FIN_WAIT_2 deliver_in_7 R send: timer_tt_rexmt_1 send: ARs maxrxtshift reached timer_tt_fin_wait_2_1 send: connect_1 connect() send: if the enqueue failed deliver_in_3 rf send: di3out deliver_in_3 rf send: di3out close_3 close() send: ARs deliver_in_6 unconstrained send: deliver_in_8 rs send: ARs deliver_out_1 send: rsf deliver_in_3b rs send: Rs process gone away deliver_in_3 rf send: di3out timer_tt_keep_1 send: Arsf connect_1 connect() send: if the enqueue failed deliver_in_3 rf send: di3out close_3 close() send: ARs deliver_in_1 ars send: ArSf segments for new conn deliver_in_3 rf send: di3out TIME_WAIT deliver_in_3b rs send: Rs process gone away deliver_in_3 rf send: di3out deliver_in_3 rf send: di3out timer_tt_2msl_1 send: deliver_in_3 rf send: di3out close_3 close() send: ARs deliver_in_7c R send: deliver_in_9 rs send: Rs no listening socket close_3 close() send: ARs deliver_out_1 send: rsf deliver_in_3b rs send: Rs process gone away deliver_in_7 R send: timer_tt_rexmt_1 send: ARs maxrxtshift reached March 18, 2005 The RFC793 Original Transmission Control Protocol Functional Specification \ active OPEN CLOSED \ < \ create TCB \ ^ \ \ snd SYN passive OPEN CLOSE \ \ \ \ create TCB delete TCB \ \ V \ \ CLOSE \ LISTEN delete TCB rcv SYN SEND V snd SYN,ACK / \ snd SYN < > SYN rcv SYN SYN RCVD < SENT snd ACK rcv ACK of SYN / rcv SYN,ACK \ x snd ACK V V CLOSE ESTAB snd FIN CLOSE rcv FIN V snd FIN / \ snd ACK FIN < > CLOSE WAIT WAIT rcv FIN \ rcv ACK CLOSE of FIN snd ACK V x V snd FIN V FINWAIT-2 CLOSING LAST-ACK rcv ACK of FIN rcv ACK of FIN rcv FIN Timeout=2MSL x V x V \ snd ACK delete TCB > TIME WAIT > CLOSED TCP Connection State Diagram Figure 6. September 1981

19 Full Formal TCP Specification Rigorous specification of TCP, UDP, and the Sockets API Written in Higher-Order Logic 360 pages printed out Can be experimentally validated against real TCP traces Has found real bugs in TCP implementations by conformance testing No proofs of TCP, just a detailed model [OPEN PROBLEM] Implementations are even more complicated [MANY HIDDEN BUGS] Papers (See ) Engineering with Logic: HOL Specification and Symbolic-Evaluation Testing for TCP Implementations. In POPL Steve Bishop, Matthew Fairbairn, Michael Norrish, Peter Sewell, Michael Smith, Keith Wansbrough. Rigorous specification and conformance testing techniques for network protocols, as applied to TCP, UDP, and Sockets. In SIGCOMM Steve Bishop, Matthew Fairbairn, Michael Norrish, Peter Sewell, Michael Smith, Keith Wansbrough.

20 Specification Methodology Define the global state of the network Local protocol state at each node, plus packets in flight Define local transitions for each node It may receive data from the application, change local state, and send a network message It may receive a message from the network, change local state, forward data to the application, and send a network message Define the environment model Model the lossyip network and the generic application Yields a definition of valid traces of the network + environment Show that all valid traces satisfy desired goals A goal can be any higher-order logic formula, including safety and liveness Proof typically proceed by induction on the length of the trace Use generic theorem proving tactics, define new specialized ones

21 Higher-Order Logic Spec: Received SYN; Sending SYNACK

22 Internet Routing Protocols Verifying Safety and Liveness

23 Routing in an Internetwork Hosts (h1,h2) connect to networks (n1,n2,n3,n4) Routers (r1,r2,r3,r4) connect two or more networks The link between a router and a network is an interface (i1,i2,i3) Routers forward packets based on routing tables Routers run a routing protocol to compute (optimal) routing tables

24 Internet Routing Protocols Intradomain Routing: Interior Gateway Protocols Routing within an Autonomous System (AS) Single administrative domain (e.g. ISP, University) Popular protocols: OSPF, IS-IS, RIP Failures can cause local outages Interdomain Routing: Exterior Gateway Protocols Routing between AS s Dominant protocol: BGP Failures can cause internet-wide outages Ad-hoc Network Routing Protocols Routing between proximate wireless mobile devices Popular protocols: AODV, DSR, OLSR Typically run in low-reliability environment

25 Routing in a network (simplified) D S Shortest Paths Problem: Find the cheapest route from S to D L(i, j) = Cost of direct link i --- j. R(a, b) = Cost of route from a to b. R(a, b) = min{ L(a, k) + R(k, b) }

26 Routing Protocol Designs Distance Vector Routing Each node keeps a table with a distance to every destination Global routing graph is computed as an asynchronous distributed computation that solves the shortest paths problem Example: RIP, AODV Path Vector Routing Each node keeps a table with the full path to every destination Each node decides its preferred paths (not necessarily shortest) Example: BGP Link State Routing Each node maintains the full link graph of the network All link updates are propagated throughout the network Global routing graph is computed locally at each node Example: OSPF

27 Routing Information Protocol (RIP) One of the oldest Internet routing protocols Based on Asynchronous Distributed Bellman-Ford [Bertsekas 91] Each node n maintains a routing table hops D : number of hops to D (no weighted edges) next D : next router on the path to D Global progress: Initially: All nodes know their neighbors (hops = 1) Finally: All nodes know distance & successor to all other nodes Local processes: Periodically send routing table to all neighbors Locally update hops D to 1 + min(received hops D ) Use timeouts to detect link breakage and expire routes

28 Distance-vector routing in RIP Initially A: 0 B: 1 C: A: 1 B: 0 C: 1 A: B: 1 C: 0 A B C After exchange A: 0 B: 1 C: 2 A: 1 B: 0 C: 1 A: 2 B: 1 C: 0

29 Routing Loops in RIP: Count to Infinity After exchange A: 0 B: 1 C: 2 A: 1 B: 0 C: 1 A: 2 B: 1 C: 0 A B C C: 2 C: 3+1=4 C: C: 2+1=3 C: 4+1=5

30 Poisoned reverse Advertise hops D = to next D Prevents loops of two routers (adds more cases for verification) A B C C: Limitation: Doesn t prevent loops of three or more routers

31 Infinity = 16 Since we can t solve the loop problem Set Infinity to 16 RIP is not to be used in a network with more than 15 hops. If a routing loop occurs, it will be discovered in at most 15 routing updates That is, the routing loop is transient Until then, packets will be forwarded in a loop Concrete protocol design deviates from theory Original proof of asynchronous distributed Bellman-Ford no longer directly applies Many corner cases, race conditions to worry about

32 Formal Goals for Routing Goal: Loop Freedom (Safety) In the global state of a routing protocol, there should not be a subset of routing tables that creates a loop on the route to D Many routing protocols have transient routing loops when links go down or come back up RIP has transient loops that may last 15 updates BGP prevents count-to-infinity by using paths AODV prevents it by using sequence numbers But AODV (v2) still had persistent routing loops

33 Formal Goals for Routing Gool: Route Convergence (Liveness) In the global state of a routing protocol, if all links remain stable, then all routing tables eventually converge Soundness: they should converge to valid routes Optimality: they should converge to minimal routes Convergence in Internet Routing Protocols: RIP converges in at most 15 routing updates AODV (-02) may converge to invalid routes! BGP may not converge!

34 AODV: Ad-hoc On-demand Distance Vector Routing Protocol Designed for Mobile Ad-hoc Networks: low-range, low-power wireless devices in battlefields or disaster areas Routes are computed on-demand to save bandwidth; loops are prevented by versioning routes D D S S

35 AODV Loop Freedom AODV is designed to prevent transient loops Avoids bandwidth wastage to unreachable nodes Loops in on-demand routes difficult to get rid of, since they cannot rely on regular route updates Each routing table entry contains: hops D, next D as before seqno D : a number indicating route freshness Only fresher routes can update an existing route Among two routes of equal freshness, smaller hop-count is preferred. Property to be formally verified is loop freedom

36 AODV Loop Freedom After exchange A: 0, 0 B: 1, 0 C: 2, 0 A: 1, 0 B: 0, 0 C: 1, 0 A: 2, 0 B: 1, 0 C: 0, 0 A B C C:, 1 C:, 1

37 Analyzing AODV for Loop-Freedom A B D We model the 3-node AODV network in SPIN Each node runs an identical Promela process A global link table encodes dynamic topology We specify loop freedom as a safety property in Linear Temporal Logic Always (!((next D (A)==B) /\ (next D (B)==A))) We run SPIN, which finds four counterexamples

38 Looping Counter-examples SPIN finds 4 cases where AODV can form loops! E.g. when routes expire, when nodes restart, In response, AODV was fixed to cover these cases

39 Looping Counter-examples Let s keep expired route but set it to infinity?

40 Looping Counter-examples Let s keep expired route but set it to infinity, increase its sequence number, and delete it later What if the route update gets dropped before the timeout?

41 Looping Counter-examples What if one of the nodes reboots? Its routing table is reset Its neighbours may not detect that it has been rebooted

42 Sufficient Conditions for Loop Freedom 1. Increase sequence number on every update, even if route expires or breaks 2. Never delete expired routes Can delete them if all other nodes have indicated knowledge of expiry in some way 3. Detect when a neighbor restarts AODV Treated as if all links to neighbors are broken Are these conditions enough to guarantee loop freedom for all runs of arbitrary AODV networks? Yes, we can prove a general theorem by combining finitary proofs in SPIN with abstraction proofs in HOL

43 Verifying RIP and AODV Detailed models derived from the standards Fully formal proofs in HOL + SPIN of AODV safety: loop freedom and route validity RIP liveness: convergence with sharp timing bounds Paper: Formal verification of standards for distance vector routing protocols, K Bhargavan, D Obradovic, C Gunter, JACM 2002

44 TLS: Verifying Security Properties

45

46

47 Secure Channels over Insecure Networks Web Server Web User Internet Man-in-the-middle attackers may We require a secure (private, reliable) channel Read data sent to and received from servers To achieve Tamper this, with we the must contents rely of on messages cryptography Impersonate A unilaterally-authenticated a user or a key server exchange protocol servers are authenticated, but clients may remain anonymous

48 Transport Layer Security (1994--) The most widely deployed cryptographic protocol Web, Wi-Fi, VPN, Mail, Chat, Voice over IP, SChannel (Windows) NSS (Firefox, Chrome) SecureTransport (ios, OSX) OpenSSL (Servers, Linux, Android) Many standardized versions and protocol extensions 1994 Netscape s Secure Sockets Layer 1995 SSL TLS1.0 (RFC2246, SSL3) 2006 TLS1.1 (RFC4346) 2008 TLS1.2 (RFC5246) Many recent flaws & attacks GotoFail, HeartBleed, 3Shake What causes these attacks?

49 Hello, I d like to connect to Google 1C has: cert Client C Server S C, pk, sk C C S has: cert S, pk, sk S S ClientHello(cr, [KEX ALG 1, KEX ALG 2,...],[ENC ALG 1, ENC ALG 2,...]) ServerHello(sr, sid, KEX ALG, ENC ALG) ServerCertificate(cert S, pk S ) Hi, I m Google (here s my certificate) Let s exchange keys with RSA Verify cert S is valid for host S 2 ServerKeyExchange(kex S ) Verify signature using pk S Ok, I have the keys Let s start talking Compute ms from kex C, kex S Authenticated Key Exchange 1 CertificateRequest ServerHelloDone 1 ClientCertificate(cert C, pk C ) (RSA or Diffie-Hellman or PSK or Kerberos or ) log 1 ClientKeyExchange(kex C ) log 1 log 2 1 CertificateVerify(sign(sk C, log 1 )) log 2 ClientCCS log 3 ClientFinished(verifydata(ms, log 2 )) log 3 Verify cert C is valid 1 Verify signature using pk C Compute ms from kex C, kex S Your keys look fine Send me data ServerCCS ServerFinished(verifydata(ms, log 3 )) Verify finished using ms Verify finished using ms Cache new session: sid, ms, cert 1 C /anon cert S, cr, sr, KEX ALG, ENC ALG I m done. Goodbye. Application Data Exchange... (HTTP or AppData SMTP i or ) AppData j... CloseNotifyAlert CloseNotifyAlert Cache new session: sid, ms, cert 1 C /anon cert S, cr, sr, KEX ALG, ENC ALG Got it. Goodbye.

50 TLS Security Goals Goal: Confidentiality: If a client C sends secret data D to server S, then D is not leaked to the adversary Goal: Authentication and Integrity: When C receives D over a connection with S, it must be that S sent D over this connection Concretely, an attacker cannot impersonate an honest HTTPS website or steal its users passwords Assumption (threat model): Network-based adversary The adversary fully controls the network and all other clients and servers We assume that C and S are honest, that is, their long-term credentials are unknown to the adversary The probability of the adversary breaking a cryptographic primitive or guessing a secret is negligible

51 What can go wrong with TLS? Implementation bugs Parsing messages incorrectly [HeartBleed] Forgetting cryptographic checks [GotoFail] Allowing messages at wrong time [SMACK, FREAK] Cryptographic weaknesses RC4, RSA-PKCS1.5, MAC-Then-Encrypt Theoretical attacks may not be immediately exploitable, but they always get you in the end [BREACH, CRIME] Incorrect protocol composition Confusing DHE with ECDHE [CrossProtocol] Session Resumption and Renegotiation [3Shake]

52 Hello, I d like to connect to Google 1C has: cert Client C Server S C, pk, sk C C S has: cert S, pk, sk S S Verify cert S is valid for host S We don t have keys yet, Verify signature using pk S but let s change ciphers Great, I know that key J ClientHello(cr, [KEX ALG 1, KEX ALG 2,...],[ENC ALG 1, ENC ALG 2,...]) ServerHello(sr, sid, KEX ALG, ENC ALG) ServerCertificate(cert S, pk S ) 2 ServerKeyExchange(kex S ) 1 CertificateRequest ServerHelloDone 1 ClientCertificate(cert C, pk C ) log 1 ClientKeyExchange(kex C ) log 1 log 2 1 CertificateVerify(sign(sk C, log 1 )) log 2 Hi, I m Google (here s my certificate) Let s exchange keys with RSA Ok, if you say so. Lets set keys to ! Verify cert C is valid Yikes, the key exchange algorithm has been bypassed. Compute ms from kex C, kex S 1 Verify signature using pk C Anybody Compute can ms read from the kex C, kex data! S log 3 ClientCCS ClientFinished(verifydata(ms, log 2 )) log 3 ServerCCS ServerFinished(verifydata(ms, log 3 )) Verify finished using ms Verify finished using ms Cache new session: sid, ms, cert C 1 /anon cert S, cr, sr, KEX ALG, ENC ALG... AppData i AppData j... CloseNotifyAlert CloseNotifyAlert Cache new session: Early CCS Injection [Kikuchi 14] sid, ms, cert 1 C /anon cert S, cr, sr, KEX ALG, ENC ALG Bug in OpenSSL state machine Found when trying to do a formal Coq proof of TLS

53 State Machine Attacks (SMACK) A series of attacks that rely on tampering with the order of protocol messages (2015) Attacks: SKIP, FREAK, LOGJAM (affects 25% of Web) Bugs in OpenSSL, Firefox, Chrome, Windows, ios,... Some bugs were 15 years old Security updates to all major browsers in 2015 For demos, see: smacktls.com Bugs and attacks found due to formal analysis Formal verification and specification-based testing See mitls project: mitls.org A Messy State of the Union: Taming the Composite State Machines of TLS. In IEEE S&P Benjamin Beurdouche, Karthikeyan Bhargavan, Antoine Delignat-Lavaud, Cédric Fournet, Markulf Kohlweiss, Alfredo Pironti, Pierre-Yves Strub, Jean Karim Zinzindohoue.

54 Triple Handshake Attack [3Shake] A new protocol-level attack on TLS in 2014 Malicious servers can impersonate user at trusted servers Relies on cryptographic weaknesses in key exchange Exploits the composition of 3 different modes of TLS Reveals unsafe implementations in mainstream browsers Affects banking websites, Wi-Fi, VPN, GIT, Chat servers

55 1C has: cert Client C Server S C, pk, sk C C S has: cert S, pk, sk S S ClientHello(cr, [KEX ALG 1, KEX ALG 2,...], [ENC ALG 1, ENC ALG 2,...]) ServerHello(sr, sid, KEX ALG, ENC ALG) ServerCertificate(cert S, pk S ) Verify cert S is valid for host S 2 ServerKeyExchange(kex S ) Verify signature using pk S 1 CertificateRequest ServerHelloDone 1 ClientCertificate(cert C, pk C ) TLS Handshake log 1 ClientKeyExchange(kex C ) log 1 [Proved secure in CRYPTO 13] log 2 1 CertificateVerify(sign(sk C, log 1 )) log 2 Verify cert C is valid Compute ms from kex C, kex S ClientCCS log 3 ClientFinished(verifydata(ms, log 2 )) log 3 1 Verify signature using pk C Compute ms from kex C, kex S ServerCCS ServerFinished(verifydata(ms, log 3 )) Verify finished using ms Verify finished using ms Cache new session: sid, ms, cert C 1 /anon cert S, cr, sr, KEX ALG, ENC ALG Application Data Exchange... AppData i AppData j... CloseNotifyAlert CloseNotifyAlert Cache new session: sid, ms, cert C 1 /anon cert S, cr, sr, KEX ALG, ENC ALG

56 TLS Renegotiation Attack [2009] Martin Rex s Version (Compound authentication failure) C connects to M M connects to S C renegotiates (connects again) with M M forwards C s messages to S S confuses data sent by C and M

57 TLS Renegotiation Fix [2009] Cryptographically bind the two handshakes Proved Secure in CCS 13 Binding won t match! S refuses to renegotiate

58 3Shake Attack [2014] Three handshakes C connects to M C resumes session on a new connection with M C renegotiates with M M can impersonate C at any other server S Relies on cryptographic weaknesses in TLS s RSA and DHE exchanges Bypasses renegotiation fix

59 3Shake Impact Security updates and CVEs Firefox, Chrome, Windows, Apple, Papers, demos: See New fix proposed for TLS protocol (IETF RFC7627) Will be mandatory for all TLS implementations Deep protocol change backed by formal analysis Attack exists since SSL 3.0 (1998) Why did nobody find it? Three (different) state machines difficult to analyze by hand; Case analysis requires automated methods The desired compound authentication property is subtle; Easier to reason about in a formal setting

60 Formal Analyses of TLS Long history of formal methods for TLS Theorem proving: Inductive analysis of the Internet protocol TLS, LC Paulson, ACM TISSEC 99 Specialized cryptographic proving (ProVerif): Cryptographically verified implementations for TLS, K Bhargavan, C Fournet, R Corin, E Zalinescu, CCS 08 Model checking: ASPIER: An Automated Framework for Verifying Security Protocol Implementations, S Chaki, A Datta, IEEE CSF 09 Type checking: Implementing TLS with verified cryptographic security K Bhargavan, C Fournet, M Kohlweiss, A Pironti, P-Y Strub

61 Symbolic Protocol Analysis Define a symbolic model of ideal cryptography E.g. symmetric encryption represented by two functions Encryption enc is injective, unbreakable without the key Decryption dec inverts encryption (only with right key): forall k, x. dec(k,enc(k,x)) = x Define a process for each protocol participant Sends and receives messages over public channels, maintains state, generates fresh secrets, calls crypto functions, Attacker is implicit and unbounded Controls all public channels Can create fresh data but cannot guess secrets Has unlimited computational power but cannot break crypto Verify that the protocol preserves security goals Undecidable in general, but known decidable protocol classes Tools like ProVerif can still verify many protocols

62 3Shake in ProVerif Client Process: Resumption Handshake Crypto Model: RSA Encryption Client Process: Initial RSA Handshake Client Process: Renegotiation Handshake ProVerif automatically finds the 3Shake attack coded as a reachability query

63 Proofs for Protocol Software Reference implementation of TLS 1.2 in F# 5000 lines of code, 2500 lines of logical specification Automated proofs by typechecking with F7 Collaboration between Microsoft Research and INRIA Supports major protocol versions, ciphersuites Papers in IEEE S&P (Oakland) 2013, CRYPTO 2014 More details, source code:

64 Summary and Conclusions

65 Protocols and their Properties TCP: Reliable Communication Channel TLS: Secure Communication Channel RIP: Convergent Distance Vector Routing AODV: Loop-Free On-Demand Routing BGP: Convergent Path Vector Routing Many other interesting protocol properties to explore (next lectures)

66 Formal Methods for Protocol Analysis Automated Theorem Proving (Coq, HOL, Isabelle) Powerful proof techniques, not very automated Example: Detailed specification of TCP in HOL Cryptographic protocol analysis (ProVerif, Tamarin) Unbounded (symbolic) attacker, not finite state Example: Proofs and attacks for TLS in ProVerif Model checking (SPIN, SMV) Proofs for finitary approximations of protocol and network Example: Proofs and counterexamples for AODV in SPIN Program analysis (Astrée, F*) Directly analyze protocol source code, not just a model Needs sound abstractions to reduce verification complexity Example: Verified TLS implementation

67 Conclusions Formal methods can be effective for the precise specification and (semi-)automated verification of network protocols They uncover attacks They explain observed phenomena They expose specification ambiguities They can aid with testing implementations Formal proofs increase our confidence in protocols and their implementations See: Formal models drive new networking paradigms like Software Defined Networking See:

68 Exercises Download and install SPIN Try out its examples and read its tutorial A B C Encode a simple static forwarding (routing) network in Promela One proctype each for A, B, C Each node non-deterministically sends messages to the others A, B, C forward messages according to topology above Show by random simulation that packets sent from A to C do reach C Can you prove that all such messages will reach C? (Liveness) Can you prove that no message is delivered to wrong node? (Safety) Can you generalize the model by using a global topology table?

69 Course Outline Lecture 1 [Today, Sep 14] Introduction, Motivating Examples Lectures 2-4 [Sep 21,28, Oct 5] Program Verification: Properties, Tools & Techniques Lectures 5-8 [Oct 12, 19, 26, Nov 2] Protocol Verification: Case Studies Lecture 9 [Nov 9] Advanced Topics Lecture 10 [Nov 16] Exam

70 Readings No textbook: Slides will be available on moodle after lecture Research Papers: Each lecture will cite several research papers; reading them is optional but recommended. (Learning to read such papers is one of the objectives of the course) Verification Tools: Some lectures will describe verification tools. Downloading tools and reading manuals is expected Similar master-level courses elsewhere: Princeton: cos598d/formalmethodsnetworkingoutline.html University of Pennsylvania:

71 End of Lecture 1

72 BGP: Unachievable Goals

73 Path Vector Routing in BGP A BGP configuration has two distinctive features Each routing entry has a full path to destination Each node has an ordered list of preferred paths BGP does not solve the shortest path problem It tries to solve the Stable Paths Problem Each node picks its most preferred path that is also consistent with its neighbors chosen path

74 BGP Convergence BGP convergence depends on configuration May not have a unique solution! May not have any solution! Real-world impact Misconfiguration can cause outages BGP routes may be unstable ( flapping ) BGP may not converge even if good routes exist

75 BGP Configurations and Solutions Not shortest paths, but still has a stable solution Has a stable solution, but BGP may diverge No solution

76 BGP Configurations and Solutions

77 Formalizing BGP Convergence Formal definition of Stable Paths Problem Can be modeled using Alloy Formal model of core BGP protocol Simple Path Vector Protocol (SPVP) Can be modeled in Promela/Spin Verify whether an SPP problem has a solution SAT solving Verify whether SPVP converges for a SPP problem Model checking Papers: The Stable Paths Problem and Interdomain Routing, TG Griffin, F Bruce Shepherd, G Wilfong, IEEE TON 02 Toward a lightweight model of BGP safety, M Arye, R Harrison, R Wang, P Zave, J Rexford, WRiPE 11

A messy state of the union:

A messy state of the union: A messy state of the union: Taming the Composite State Machines of TLS http://smacktls.com Benjamin Beurdouche, Karthikeyan Bhargavan, Antoine Delignat-Lavaud, Cédric Fournet, Markulf Kohlweiss, Alfredo

More information

for Compound Authentication

for Compound Authentication Verified Contributive Channel Bindings for Compound Authentication Antoine Delignat-Lavaud, Inria Paris Joint work with Karthikeyan Bhargavan and Alfredo Pironti Motivation: Authentication Composition

More information

Verifying Real-World Security Protocols from finding attacks to proving security theorems

Verifying Real-World Security Protocols from finding attacks to proving security theorems Verifying Real-World Security Protocols from finding attacks to proving security theorems Karthik Bhargavan http://prosecco.inria.fr + many co-authors at INRIA, Microsoft Research, Formal security analysis

More information

INF672 Protocol Safety and Verification. Karthik Bhargavan Xavier Rival Thomas Clausen

INF672 Protocol Safety and Verification. Karthik Bhargavan Xavier Rival Thomas Clausen INF672 Protocol Safety and Verication Karthik Bhargavan Xavier Rival Thomas Clausen 1 Course Outline Lecture 1 [Today, Sep 15] Introduction, Motivating Examples Lectures 2-4 [Sep 22,29, Oct 6] Network

More information

*the Everest VERified End-to-end Secure Transport. Verified Secure Implementations for the HTTPS Ecosystem mitls & Everest*

*the Everest VERified End-to-end Secure Transport. Verified Secure Implementations for the HTTPS Ecosystem mitls & Everest* *the Everest VERified End-to-end Secure Transport Verified Secure Implementations for the HTTPS Ecosystem mitls & Everest* Edge Clients Services & Applications curl WebKit Skype IIS Apache HTTPS Ecosystem

More information

Connections. Topics. Focus. Presentation Session. Application. Data Link. Transport. Physical. Network

Connections. Topics. Focus. Presentation Session. Application. Data Link. Transport. Physical. Network Connections Focus How do we connect processes? This is the transport layer Topics Naming processes Connection setup / teardown Flow control Application Presentation Session Transport Network Data Link

More information

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data

UDP and TCP. Introduction. So far we have studied some data link layer protocols such as PPP which are responsible for getting data ELEX 4550 : Wide Area Networks 2015 Winter Session UDP and TCP is lecture describes the two most common transport-layer protocols used by IP networks: the User Datagram Protocol (UDP) and the Transmission

More information

Not-quite-so-broken TLS 1.3 mechanised conformance checking

Not-quite-so-broken TLS 1.3 mechanised conformance checking Not-quite-so-broken TLS 1.3 mechanised conformance checking David Kaloper-Meršinjak University of Cambridge Hannes Mehnert University of Cambridge Abstract We present a set of tools to aid TLS 1.3 implementors,

More information

CSE 461 The Transport Layer

CSE 461 The Transport Layer CSE 461 The Transport Layer The Transport Layer Focus How do we (reliably) connect processes? This is the transport layer Topics Naming end points UDP: unreliable transport TCP: reliable transport Connection

More information

Lecture Nov. 21 st 2006 Dan Wendlandt ISP D ISP B ISP C ISP A. Bob. Alice. Denial-of-Service. Password Cracking. Traffic.

Lecture Nov. 21 st 2006 Dan Wendlandt ISP D ISP B ISP C ISP A. Bob. Alice. Denial-of-Service. Password Cracking. Traffic. 15-441 Lecture Nov. 21 st 2006 Dan Wendlandt Worms & Viruses Phishing End-host impersonation Denial-of-Service Route Hijacks Traffic modification Spyware Trojan Horse Password Cracking IP Spoofing DNS

More information

CSEP 561 Connections. David Wetherall

CSEP 561 Connections. David Wetherall CSEP 561 Connections David Wetherall djw@cs.washington.edu Connections Focus How do we (reliably) connect processes? This is the transport layer Topics Naming processes TCP / UDP Connection setup / teardown

More information

CSE 461 Connections. David Wetherall

CSE 461 Connections. David Wetherall CSE 461 Connections David Wetherall djw@cs.washington.edu Connections Focus How do we (reliably) connect processes? This is the transport layer Topics Naming processes TCP / UDP Connection setup / teardown

More information

The TCP Specification: A Quick Introduction

The TCP Specification: A Quick Introduction The TCP Specification: A Quick Introduction Steve Bishop, Matthew Fairbairn, Michael Norrish, Peter Sewell, Michael Smith, Keith Wansbrough March 21, 2005 What is this specification? A mathematical model

More information

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link.

Internet Layers. Physical Layer. Application. Application. Transport. Transport. Network. Network. Network. Network. Link. Link. Link. Internet Layers Application Application Transport Transport Network Network Network Network Link Link Link Link Ethernet Fiber Optics Physical Layer Wi-Fi ARP requests and responses IP: 192.168.1.1 MAC:

More information

Chapter 4: Securing TCP connections

Chapter 4: Securing TCP connections Managing and Securing Computer Networks Guy Leduc Chapter 5: Securing TCP connections Computer Networking: A Top Down Approach, 6 th edition. Jim Kurose, Keith Ross Addison-Wesley, March 2012. (section

More information

Some slides courtesy David Wetherall. Communications Software. Lecture 4: Connections and Flow Control. CSE 123b. Spring 2003.

Some slides courtesy David Wetherall. Communications Software. Lecture 4: Connections and Flow Control. CSE 123b. Spring 2003. CSE 123b Communications Software Spring 2003 Lecture 4: Connections and Flow Control Stefan Savage Some slides courtesy David Wetherall Administrativa Computer accounts have been setup You can use the

More information

Securing Internet Communication: TLS

Securing Internet Communication: TLS Securing Internet Communication: TLS CS 161: Computer Security Prof. David Wagner March 11, 2016 Today s Lecture Applying crypto technology in practice Two simple abstractions cover 80% of the use cases

More information

CSEP 561 Connections. David Wetherall

CSEP 561 Connections. David Wetherall CSEP 561 Connections David Wetherall djw@cs.washington.edu Connections Focus How do we (reliably) connect processes? This is the transport layer Topics Naming processes Connection setup / teardown Sliding

More information

Expires: September 10, 2015 Inria Paris-Rocquencourt A. Langley Google Inc. M. Ray Microsoft Corp. March 9, 2015

Expires: September 10, 2015 Inria Paris-Rocquencourt A. Langley Google Inc. M. Ray Microsoft Corp. March 9, 2015 Network Working Group Internet-Draft Expires: September 10, 2015 K. Bhargavan A. Delignat-Lavaud A. Pironti Inria Paris-Rocquencourt A. Langley Google Inc. M. Ray Microsoft Corp. March 9, 2015 Transport

More information

CSE 461 Module 11. Connections

CSE 461 Module 11. Connections CSE 461 Module 11 Connections This Time More on the Transport Layer Focus How do we connect processes? Topics Naming processes Connection setup / teardown Flow control Application Presentation Session

More information

Information Security CS 526

Information Security CS 526 Information Security CS 526 Topic 14: Key Distribution & Agreement, Secure Communication Topic 14: Secure Communication 1 Readings for This Lecture On Wikipedia Needham-Schroeder protocol (only the symmetric

More information

CSC 574 Computer and Network Security. TCP/IP Security

CSC 574 Computer and Network Security. TCP/IP Security CSC 574 Computer and Network Security TCP/IP Security Alexandros Kapravelos kapravelos@ncsu.edu (Derived from slides by Will Enck and Micah Sherr) Network Stack, yet again Application Transport Network

More information

A Formal Specification for RIP Protocol

A Formal Specification for RIP Protocol A Formal Specification for RIP Protocol 1 Dan Pei 1, Dan Massey 2 and Lixia Zhang 1 UCLA 1 Colorado State University 2 {peidan, lixia}@cs.ucla.edu massey@cs.colostate.edu UCLA CSD Technical Report TR040046

More information

CSE/EE 461 Lecture 14. Connections. Last Time. This Time. We began on the Transport layer. Focus How do we send information reliably?

CSE/EE 461 Lecture 14. Connections. Last Time. This Time. We began on the Transport layer. Focus How do we send information reliably? CSE/EE 461 Lecture 14 Connections Last Time We began on the Transport layer Focus How do we send information reliably? Topics ARQ and sliding windows Application Presentation Session Transport Network

More information

Lecture 6. Internet Security: How the Internet works and some basic vulnerabilities. Thursday 19/11/2015

Lecture 6. Internet Security: How the Internet works and some basic vulnerabilities. Thursday 19/11/2015 Lecture 6 Internet Security: How the Internet works and some basic vulnerabilities Thursday 19/11/2015 Agenda Internet Infrastructure: Review Basic Security Problems Security Issues in Routing Internet

More information

Lecture outline. Internet Routing Security Issues. Previous lecture: Effect of MinRouteAdver Timer. Recap of previous lecture

Lecture outline. Internet Routing Security Issues. Previous lecture: Effect of MinRouteAdver Timer. Recap of previous lecture Lecture outline Internet Routing Security Issues Z. Morley Mao Lecture 3 Jan 14, 2003 Recap of last lecture, any questions? Existing routing security mechanisms - SBGP General threats to routing protocols

More information

A Survey of BGP Security Review

A Survey of BGP Security Review A Survey of BGP Security Review Network Security Instructor:Dr. Shishir Nagaraja Submitted By: Jyoti Leeka November 16, 2011 1 Introduction to the topic and the reason for the topic being interesting Border

More information

Transport Layer Marcos Vieira

Transport Layer Marcos Vieira Transport Layer 2014 Marcos Vieira Transport Layer Transport protocols sit on top of network layer and provide Application-level multiplexing ( ports ) Error detection, reliability, etc. UDP User Datagram

More information

Data Security and Privacy. Topic 14: Authentication and Key Establishment

Data Security and Privacy. Topic 14: Authentication and Key Establishment Data Security and Privacy Topic 14: Authentication and Key Establishment 1 Announcements Mid-term Exam Tuesday March 6, during class 2 Need for Key Establishment Encrypt K (M) C = Encrypt K (M) M = Decrypt

More information

ENGINEERING TCP/IP WITH LOGIC

ENGINEERING TCP/IP WITH LOGIC ENGINEERING TCPIP WITH LOGIC Hannes Mehnert*, robur.io, @h4nnes based on work by Peter Sewell*, Michael Norrish^, Tom Ridge* earlier contributors are Steve Bishop*, Matthew Fairbairn*, Michael Smith*,

More information

Stream Control Transmission Protocol (SCTP)

Stream Control Transmission Protocol (SCTP) Stream Control Transmission Protocol (SCTP) Definition Stream control transmission protocol (SCTP) is an end-to-end, connectionoriented protocol that transports data in independent sequenced streams. SCTP

More information

On the Internet, nobody knows you re a dog.

On the Internet, nobody knows you re a dog. On the Internet, nobody knows you re a dog. THREATS TO DISTRIBUTED APPLICATIONS 1 Jane Q. Public Big Bank client s How do I know I am connecting to my bank? server s Maybe an attacker...... sends you phishing

More information

Securing BGP. Geoff Huston November 2007

Securing BGP. Geoff Huston November 2007 Securing BGP Geoff Huston November 2007 Agenda An Introduction to BGP BGP Security Questions Current Work Research Questions An Introduction to BGP Background to Internet Routing The routing architecture

More information

Last Class. CSE 123b Communications Software. Today. Naming Processes/Services. Transmission Control Protocol (TCP) Picking Port Numbers.

Last Class. CSE 123b Communications Software. Today. Naming Processes/Services. Transmission Control Protocol (TCP) Picking Port Numbers. CSE 123b Communications Software Spring 2002 Lecture 4: Connections and Flow Control Stefan Savage Last Class We talked about how to implement a reliable channel in the transport layer Approaches ARQ (Automatic

More information

CS 43: Computer Networks. 18: Transmission Control Protocol October 12-29, 2018

CS 43: Computer Networks. 18: Transmission Control Protocol October 12-29, 2018 CS 43: Computer Networks 18: Transmission Control Protocol October 12-29, 2018 Reading Quiz Lecture 18 - Slide 2 Midterm topics Abstraction, Layering, End-to-end design HTTP, DNS, Email, BT, etc. (app

More information

CSE/EE 461 Lecture 13 Connections and Fragmentation. TCP Connection Management

CSE/EE 461 Lecture 13 Connections and Fragmentation. TCP Connection Management CSE/EE 461 Lecture 13 Connections and Fragmentation Tom Anderson tom@cs.washington.edu Peterson, Chapter 5.2 TCP Connection Management Setup assymetric 3-way handshake Transfer sliding window; data and

More information

CS457 Transport Protocols. CS 457 Fall 2014

CS457 Transport Protocols. CS 457 Fall 2014 CS457 Transport Protocols CS 457 Fall 2014 Topics Principles underlying transport-layer services Demultiplexing Detecting corruption Reliable delivery Flow control Transport-layer protocols User Datagram

More information

Closed book. Closed notes. No electronic device.

Closed book. Closed notes. No electronic device. 414-S17 (Shankar) Exam 3 PRACTICE PROBLEMS Page 1/6 Closed book. Closed notes. No electronic device. 1. Anonymity Sender k-anonymity Receiver k-anonymity Authoritative nameserver Autonomous system BGP

More information

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet

Chapter 2 - Part 1. The TCP/IP Protocol: The Language of the Internet Chapter 2 - Part 1 The TCP/IP Protocol: The Language of the Internet Protocols A protocol is a language or set of rules that two or more computers use to communicate 2 Protocol Analogy: Phone Call Parties

More information

Auth. Key Exchange. Dan Boneh

Auth. Key Exchange. Dan Boneh Auth. Key Exchange Review: key exchange Alice and want to generate a secret key Saw key exchange secure against eavesdropping Alice k eavesdropper?? k This lecture: Authenticated Key Exchange (AKE) key

More information

CSCI-1680 Transport Layer I Rodrigo Fonseca

CSCI-1680 Transport Layer I Rodrigo Fonseca CSCI-1680 Transport Layer I Rodrigo Fonseca Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Today Transport Layer UDP TCP Intro Connection Establishment From Lec 2: OSI Reference

More information

Network Layer: Routing

Network Layer: Routing Network Layer: Routing The Problem A B R 1 R 2 R 4 R 3 Goal: for each destination, compute next hop 1 Lecture 9 2 Basic Assumptions Trivial solution: Flooding Dynamic environment: links and routers unreliable:

More information

L41: Lab 4 - The TCP State Machine

L41: Lab 4 - The TCP State Machine L41: Lab 4 - The TCP State Machine Dr Robert N. M. Watson 29 January 2016 Dr Robert N. M. Watson L41: Lab 4 - The TCP State Machine 29 January 2016 1 / 10 L41: Lab 4 - The TCP State Machine The TCP state

More information

CSCD 330 Network Programming Spring 2018

CSCD 330 Network Programming Spring 2018 CSCD 330 Network Programming Spring 018 Lecture 16 Network Layer Routing Protocols Reading: Chapter 4 Some slides provided courtesy of J.F Kurose and K.W. Ross, All Rights Reserved, copyright 017 1 Network

More information

Network Security: TLS/SSL. Tuomas Aura T Network security Aalto University, Nov-Dec 2014

Network Security: TLS/SSL. Tuomas Aura T Network security Aalto University, Nov-Dec 2014 Network Security: TLS/SSL Tuomas Aura T-110.5241 Network security Aalto University, Nov-Dec 2014 Outline 1. Diffie-Hellman key exchange (recall from earlier) 2. Key exchange using public-key encryption

More information

CSCD 330 Network Programming Spring 2017

CSCD 330 Network Programming Spring 2017 CSCD 330 Network Programming Spring 017 Lecture 16 Network Layer Routing Protocols Reading: Chapter 4 Some slides provided courtesy of J.F Kurose and K.W. Ross, All Rights Reserved, copyright 1996-007

More information

Protecting TLS from Legacy Crypto

Protecting TLS from Legacy Crypto Protecting TLS from Legacy Crypto http://mitls.org Karthikeyan Bhargavan + many, many others. (INRIA, Microsoft Research, LORIA, IMDEA, Univ of Pennsylvania, Univ of Michigan, JHU) Popular cryptographic

More information

Overview of SSL/TLS. Luke Anderson. 12 th May University Of Sydney.

Overview of SSL/TLS. Luke Anderson. 12 th May University Of Sydney. Overview of SSL/TLS Luke Anderson luke@lukeanderson.com.au 12 th May 2017 University Of Sydney Overview 1. Introduction 1.1 Raw HTTP 1.2 Introducing SSL/TLS 2. Certificates 3. Attacks Introduction Raw

More information

A Messy State of the Union: Taming the Composite State Machines of TLS

A Messy State of the Union: Taming the Composite State Machines of TLS A Messy State of the Union: Taming the Composite State Machines of TLS Benjamin Beurdouche, Karthikeyan Bhargavan, Antoine Delignat-Lavaud, Cédric Fournet, Markulf Kohlweiss, Alfredo Pironti, Pierre-Yves

More information

EEC-682/782 Computer Networks I

EEC-682/782 Computer Networks I EEC-682/782 Computer Networks I Lecture 15 Wenbing Zhao w.zhao1@csuohio.edu http://academic.csuohio.edu/zhao_w/teaching/eec682.htm (Lecture nodes are based on materials supplied by Dr. Louise Moser at

More information

SSL/TLS & 3D Secure. CS 470 Introduction to Applied Cryptography. Ali Aydın Selçuk. CS470, A.A.Selçuk SSL/TLS & 3DSec 1

SSL/TLS & 3D Secure. CS 470 Introduction to Applied Cryptography. Ali Aydın Selçuk. CS470, A.A.Selçuk SSL/TLS & 3DSec 1 SSL/TLS & 3D Secure CS 470 Introduction to Applied Cryptography Ali Aydın Selçuk CS470, A.A.Selçuk SSL/TLS & 3DSec 1 SSLv2 Brief History of SSL/TLS Released in 1995 with Netscape 1.1 Key generation algorithm

More information

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur

Cryptography and Network Security. Prof. D. Mukhopadhyay. Department of Computer Science and Engineering. Indian Institute of Technology, Kharagpur Cryptography and Network Security Prof. D. Mukhopadhyay Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Module No. # 01 Lecture No. # 38 A Tutorial on Network Protocols

More information

C13b: Routing Problem and Algorithms

C13b: Routing Problem and Algorithms CISC 7332X T6 C13b: Routing Problem and Algorithms Hui Chen Department of Computer & Information Science CUNY Brooklyn College 11/20/2018 CUNY Brooklyn College 1 Acknowledgements Some pictures used in

More information

TCP/IP Networking. Part 4: Network and Transport Layer Protocols

TCP/IP Networking. Part 4: Network and Transport Layer Protocols TCP/IP Networking Part 4: Network and Transport Layer Protocols Orientation Application Application protocol Application TCP TCP protocol TCP IP IP protocol IP IP protocol IP IP protocol IP Network Access

More information

R (2) Implementation of following spoofing assignments using C++ multi-core Programming a) IP Spoofing b) Web spoofing.

R (2) Implementation of following spoofing assignments using C++ multi-core Programming a) IP Spoofing b) Web spoofing. R (2) N (5) Oral (3) Total (10) Dated Sign Experiment No: 1 Problem Definition: Implementation of following spoofing assignments using C++ multi-core Programming a) IP Spoofing b) Web spoofing. 1.1 Prerequisite:

More information

Authenticated Encryption in TLS

Authenticated Encryption in TLS Authenticated Encryption in TLS Same modelling & verification approach concrete security: each lossy step documented by a game and a reduction (or an assumption) on paper Standardized complications - multiple

More information

Reliable Transport I: Concepts and TCP Protocol

Reliable Transport I: Concepts and TCP Protocol Reliable Transport I: Concepts and TCP Protocol Stefano Vissicchio UCL Computer Science COMP0023 Today Transport Concepts Layering context Transport goals Transport mechanisms and design choices TCP Protocol

More information

Distance vector and RIP

Distance vector and RIP DD2490 p4 2008 Distance vector and RIP Olof Hagsand KTHNOC/NADA Literature RIP lab RFC 245: RIPv2. Sections 1 2 contains some introduction that can be useful to understand the context in which RIP is specified..1.4

More information

(Refer Slide Time: 01:08 to 01:25min)

(Refer Slide Time: 01:08 to 01:25min) COMPUTER NETWORKS Prof. Sujoy Ghosh Department of Computer Science and Engineering Indian Institute of Technology, Kharagpur Lecture-27 RIP- Distance Vector Routing We have seen basic routing. Now we will

More information

Configuring attack detection and prevention 1

Configuring attack detection and prevention 1 Contents Configuring attack detection and prevention 1 Overview 1 Attacks that the device can prevent 1 Single-packet attacks 1 Scanning attacks 2 Flood attacks 3 TCP fragment attack 4 Login DoS attack

More information

ARP, IP, TCP, UDP. CS 166: Introduction to Computer Systems Security 4/7/18 ARP, IP, TCP, UDP 1

ARP, IP, TCP, UDP. CS 166: Introduction to Computer Systems Security 4/7/18 ARP, IP, TCP, UDP 1 ARP, IP, TCP, UDP CS 166: Introduction to Computer Systems Security 4/7/18 ARP, IP, TCP, UDP 1 IP and MAC Addresses Devices on a local area network have IP addresses (network layer) MAC addresses (data

More information

Securing Internet Communication

Securing Internet Communication Securing Internet Communication CS 161 - Computer Security Profs. Vern Paxson & David Wagner TAs: John Bethencourt, Erika Chin, Matthew Finifter, Cynthia Sturton, Joel Weinberger http://inst.eecs.berkeley.edu/~cs161/

More information

A Survey of BGP Security: Issues and Solutions

A Survey of BGP Security: Issues and Solutions A Survey of BGP Security: Issues and Solutions Butler, Farley, McDaniel, Rexford Kyle Super CIS 800/003 October 3, 2011 Outline Introduction/Motivation Sources of BGP Insecurity BGP Security Today BGP

More information

E-commerce security: SSL/TLS, SET and others. 4.1

E-commerce security: SSL/TLS, SET and others. 4.1 E-commerce security: SSL/TLS, SET and others. 4.1 1 Electronic payment systems Purpose: facilitate the safe and secure transfer of monetary value electronically between multiple parties Participating parties:

More information

CPSC 467: Cryptography and Computer Security

CPSC 467: Cryptography and Computer Security CPSC 467: Cryptography and Computer Security Michael J. Fischer Lecture 24a December 2, 2013 CPSC 467, Lecture 24a 1/20 Secure Shell (SSH) Transport Layer Security (TLS) Digital Rights Management and Trusted

More information

CSCI-1680 Transport Layer I Rodrigo Fonseca

CSCI-1680 Transport Layer I Rodrigo Fonseca CSCI-1680 Transport Layer I Rodrigo Fonseca Based partly on lecture notes by David Mazières, Phil Levis, John Janno< Today Transport Layer UDP TCP Intro Connection Establishment Transport Layer "#$ -##$

More information

SharkFest 17 Europe. SSL/TLS Decryption. uncovering secrets. Wednesday November 8th, Peter Wu Wireshark Core Developer

SharkFest 17 Europe. SSL/TLS Decryption. uncovering secrets. Wednesday November 8th, Peter Wu Wireshark Core Developer SharkFest 17 Europe SSL/TLS Decryption uncovering secrets Wednesday November 8th, 2017 Peter Wu Wireshark Core Developer peter@lekensteyn.nl 1 About me Wireshark contributor since 2013, core developer

More information

Towards a Logic for Wide-Area Internet Routing

Towards a Logic for Wide-Area Internet Routing Towards a Logic for Wide-Area Internet Routing Nick Feamster and Hari Balakrishnan M.I.T. Computer Science and Artificial Intelligence Laboratory {feamster,hari}@lcs.mit.edu ; #, $. ', - -, * - ' * 4 *

More information

CIS 5373 Systems Security

CIS 5373 Systems Security CIS 5373 Systems Security Topic 4.1: Network Security Basics Endadul Hoque Slide Acknowledgment Contents are based on slides from Cristina Nita-Rotaru (Northeastern) 2 Network Security INTRODUCTION 3 What

More information

CSE 565 Computer Security Fall 2018

CSE 565 Computer Security Fall 2018 CSE 565 Computer Security Fall 2018 Lecture 18: Network Attacks Department of Computer Science and Engineering University at Buffalo 1 Lecture Overview Network attacks denial-of-service (DoS) attacks SYN

More information

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved.

Introduction to Networking. Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. Introduction to Networking Operating Systems In Depth XXVII 1 Copyright 2017 Thomas W. Doeppner. All rights reserved. Distributed File Systems Operating Systems In Depth XXVII 2 Copyright 2017 Thomas W.

More information

Release Notes for Epilog for Windows Release Notes for Epilog for Windows v1.7

Release Notes for Epilog for Windows Release Notes for Epilog for Windows v1.7 Release Notes for Epilog for Windows v1.7 InterSect Alliance International Pty Ltd Page 1 of 16 About this document This document provides release notes for Snare Enterprise Epilog for Windows release.

More information

TSIN02 - Internetworking

TSIN02 - Internetworking Literature: Lecture 10: AAA RFC3286 RFC2881 RFC2905 RFC2903 Lecture 10: AAA Goals: 2004 Image Coding Group, Linköpings Universitet 2 Lecture 10: AAA AAA Introduction Outline: AAA introduction AAA in Network

More information

Internet Engineering Task Force (IETF) Google Inc. M. Ray Microsoft Corp. September 2015

Internet Engineering Task Force (IETF) Google Inc. M. Ray Microsoft Corp. September 2015 Internet Engineering Task Force (IETF) Request for Comments: 7627 Updates: 5246 Category: Standards Track ISSN: 2070-1721 K. Bhargavan, Ed. A. Delignat-Lavaud A. Pironti Inria Paris-Rocquencourt A. Langley

More information

WAP Security. Helsinki University of Technology S Security of Communication Protocols

WAP Security. Helsinki University of Technology S Security of Communication Protocols WAP Security Helsinki University of Technology S-38.153 Security of Communication Protocols Mikko.Kerava@iki.fi 15.4.2003 Contents 1. Introduction to WAP 2. Wireless Transport Layer Security 3. Other WAP

More information

Single Network: applications, client and server hosts, switches, access links, trunk links, frames, path. Review of TCP/IP Internetworking

Single Network: applications, client and server hosts, switches, access links, trunk links, frames, path. Review of TCP/IP Internetworking 1 Review of TCP/IP working Single Network: applications, client and server hosts, switches, access links, trunk links, frames, path Frame Path Chapter 3 Client Host Trunk Link Server Host Panko, Corporate

More information

Configuring attack detection and prevention 1

Configuring attack detection and prevention 1 Contents Configuring attack detection and prevention 1 Overview 1 Attacks that the device can prevent 1 Single-packet attacks 1 Scanning attacks 2 Flood attacks 3 TCP fragment attack 4 Login DoS attack

More information

ECE 435 Network Engineering Lecture 9

ECE 435 Network Engineering Lecture 9 ECE 435 Network Engineering Lecture 9 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 2 October 2018 Announcements HW#4 was posted, due Thursday 1 HW#3 Review md5sum/encryption,

More information

Transport: How Applications Communicate

Transport: How Applications Communicate Transport: How Applications Communicate Week 2 Philip Levis 1 7 Layers (or 4) 7. 6. 5. 4. 3. 2. 1. Application Presentation Session Transport Network Link Physical segments packets frames bits/bytes Application

More information

CSCI 680: Computer & Network Security

CSCI 680: Computer & Network Security CSCI 680: Computer & Network Security Lecture 15 Prof. Adwait Nadkarni Fall 2017 Derived from slides by William Enck and Micah Sherr 1 Grading Class Participat ion and Quizzes 10% Grade Breakdown Homewo

More information

Reliable Transport I: Concepts and TCP Protocol

Reliable Transport I: Concepts and TCP Protocol Reliable Transport I: Concepts and TCP Protocol Brad Karp UCL Computer Science CS 3035/GZ01 29 th October 2013 Part I: Transport Concepts Layering context Transport goals Transport mechanisms 2 Context:

More information

CPSC 467b: Cryptography and Computer Security

CPSC 467b: Cryptography and Computer Security CPSC 467b: Cryptography and Computer Security Michael J. Fischer Lecture 24 April 16, 2012 CPSC 467b, Lecture 24 1/33 Kerberos Secure Shell (SSH) Transport Layer Security (TLS) Digital Rights Management

More information

User Datagram Protocol

User Datagram Protocol Topics Transport Layer TCP s three-way handshake TCP s connection termination sequence TCP s TIME_WAIT state TCP and UDP buffering by the socket layer 2 Introduction UDP is a simple, unreliable datagram

More information

Networking: Network layer

Networking: Network layer control Networking: Network layer Comp Sci 3600 Security Outline control 1 2 control 3 4 5 Network layer control Outline control 1 2 control 3 4 5 Network layer purpose: control Role of the network layer

More information

Introduction to cryptology (GBIN8U16) Introduction

Introduction to cryptology (GBIN8U16) Introduction Introduction to cryptology (GBIN8U16) Introduction Pierre Karpman pierre.karpman@univ-grenoble-alpes.fr https://www-ljk.imag.fr/membres/pierre.karpman/tea.html 2018 01 24 Introduction 2018 01 24 1/27 First

More information

Routing Protocol comparison

Routing Protocol comparison Routing Protocol comparison Introduction to routing Networks allow people to communicate, collaborate, and interact in many ways. Networks are used to access web pages, talk using IP telephones, participate

More information

Overview. SSL Cryptography Overview CHAPTER 1

Overview. SSL Cryptography Overview CHAPTER 1 CHAPTER 1 Secure Sockets Layer (SSL) is an application-level protocol that provides encryption technology for the Internet. SSL ensures the secure transmission of data between a client and a server through

More information

CS 138: Communication I. CS 138 V 1 Copyright 2012 Thomas W. Doeppner. All rights reserved.

CS 138: Communication I. CS 138 V 1 Copyright 2012 Thomas W. Doeppner. All rights reserved. CS 138: Communication I CS 138 V 1 Copyright 2012 Thomas W. Doeppner. All rights reserved. Topics Network Metrics Layering Reliability Congestion Control Routing CS 138 V 2 Copyright 2012 Thomas W. Doeppner.

More information

Unicast Routing. TCP/IP class

Unicast Routing. TCP/IP class Unicast Routing TCP/IP class Routing Protocols intro RIP and son of RIP OSPF BGP odd bodkins NAT TCP/IP Internetworking Protocols 2 divide routing world into 3 parts topology IETF ISO/OSI same link or

More information

Routing Protocols --- Exterior Gateway Protocol

Routing Protocols --- Exterior Gateway Protocol Content Routing Protocols --- Exterior Gateway Protocol Linda Wu (CMPT 471 23-3) Limiting router interaction Autonomous system BGP protocol BGP messages Other issues on BGP Reference: chapter 15 Notes-13

More information

MTAT Applied Cryptography

MTAT Applied Cryptography MTAT.07.017 Applied Cryptography Transport Layer Security (TLS) Advanced Features University of Tartu Spring 2016 1 / 16 Client Server Authenticated TLS ClientHello ServerHello, Certificate, ServerHelloDone

More information

The World Wide Web is widely used by businesses, government agencies, and many individuals. But the Internet and the Web are extremely vulnerable to

The World Wide Web is widely used by businesses, government agencies, and many individuals. But the Internet and the Web are extremely vulnerable to 1 The World Wide Web is widely used by businesses, government agencies, and many individuals. But the Internet and the Web are extremely vulnerable to compromises of various sorts, with a range of threats

More information

Unit 3: Dynamic Routing

Unit 3: Dynamic Routing Unit 3: Dynamic Routing Basic Routing The term routing refers to taking a packet from one device and sending it through the network to another device on a different network. Routers don t really care about

More information

Computer Security 3e. Dieter Gollmann. Chapter 18: 1

Computer Security 3e. Dieter Gollmann.  Chapter 18: 1 Computer Security 3e Dieter Gollmann www.wiley.com/college/gollmann Chapter 18: 1 Chapter 18: Web Security Chapter 18: 2 Web 1.0 browser HTTP request HTML + CSS data web server backend systems Chapter

More information

FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY

FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY FORMAL METHODS IN NETWORKING COMPUTER SCIENCE 598D, SPRING 2010 PRINCETON UNIVERSITY LIGHTWEIGHT MODELING IN PROMELA/SPIN AND ALLOY Pamela Zave AT&T Laboratories Research Florham Park, New Jersey, USA

More information

Network Security. Evil ICMP, Careless TCP & Boring Security Analyses. Mohamed Sabt Univ Rennes, CNRS, IRISA Thursday, October 4th, 2018

Network Security. Evil ICMP, Careless TCP & Boring Security Analyses. Mohamed Sabt Univ Rennes, CNRS, IRISA Thursday, October 4th, 2018 Network Security Evil ICMP, Careless TCP & Boring Security Analyses Mohamed Sabt Univ Rennes, CNRS, IRISA Thursday, October 4th, 2018 Part I Internet Control Message Protocol (ICMP) Why ICMP No method

More information

The case for ubiquitous transport-level encryption

The case for ubiquitous transport-level encryption 1/25 The case for ubiquitous transport-level encryption Andrea Bittau, Michael Hamburg, Mark Handley, David Mazières, and Dan Boneh Stanford and UCL November 18, 2010 Goals 2/25 What would it take to encrypt

More information

Examination 2D1392 Protocols and Principles of the Internet 2G1305 Internetworking 2G1507 Kommunikationssystem, fk SOLUTIONS

Examination 2D1392 Protocols and Principles of the Internet 2G1305 Internetworking 2G1507 Kommunikationssystem, fk SOLUTIONS Examination 2D1392 Protocols and Principles of the Internet 2G1305 Internetworking 2G1507 Kommunikationssystem, fk Date: January 17 th 2006 at 14:00 18:00 SOLUTIONS 1. General (5p) a) Draw the layered

More information

Network Security - ISA 656 IPsec IPsec Key Management (IKE)

Network Security - ISA 656 IPsec IPsec Key Management (IKE) Network Security - ISA 656 IPsec IPsec (IKE) Angelos Stavrou September 28, 2008 What is IPsec, and Why? What is IPsec, and Why? History IPsec Structure Packet Layout Header (AH) AH Layout Encapsulating

More information

Network Security and Cryptography. December Sample Exam Marking Scheme

Network Security and Cryptography. December Sample Exam Marking Scheme Network Security and Cryptography December 2015 Sample Exam Marking Scheme This marking scheme has been prepared as a guide only to markers. This is not a set of model answers, or the exclusive answers

More information