Presentation is loading. Please wait.

Presentation is loading. Please wait.

Vishal Nehru Computer Science 428 Understanding Network Protocols: The BitTorrent Case.

Similar presentations


Presentation on theme: "Vishal Nehru Computer Science 428 Understanding Network Protocols: The BitTorrent Case."— Presentation transcript:

1 Vishal Nehru Computer Science 428 Understanding Network Protocols: The BitTorrent Case

2 Understanding Network Protocols What is common to Taco Bell, James Bond, the US Postal Service and Protocols?

3 What are Protocols? A set of rules governing communication between electronics devices.

4 What are Protocols? A set of rules governing communication between electronics devices. i.e., rules governing the syntax, semantics and synchronization of network communication.

5 What do protocols do? Most protocols specify one or more of the following behaviors: Detection of underlying physical connection. Detection of underlying physical connection. Handshaking Handshaking (agreeing on parameters such as transfer rate, parity, interrupts) How to start and end a message How to start and end a message How to format a message How to format a message What to do with corrupted or improperly formatted messages (error correction) What to do with corrupted or improperly formatted messages (error correction) How to detect unexpected loss of the connection, and what to do next How to detect unexpected loss of the connection, and what to do next Termination of the session or connection Termination of the session or connection

6 Protocol Layering OSI model (Open Systems Interconnection) divides the functions of a protocol into a series of 7 logical layers. OSI model (Open Systems Interconnection) divides the functions of a protocol into a series of 7 logical layers. Each layer can be implemented in hardware or software. Each layer can be implemented in hardware or software. Analogous to programming and electronic abstractions. Analogous to programming and electronic abstractions.

7 Application Layer: Interface between software and lower layer network services, e.g. HTTP, SMTP, FTP, Telnet. Presentation Layer: Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Session Layer: Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Transport Layer: Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. Network Layer: network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Data Link Layer: Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. Physical Layer: defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. The 7 Protocol Layers

8 Application Layer: Interface between software and lower layer network services, e.g. HTTP, SMTP, FTP, Telnet. Presentation Layer: Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Session Layer: Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Transport Layer: Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. Network Layer: network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. Data Link Layer: Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. Physical Layer: defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. The 7 Protocol Layers

9 Application Layer: Interface between software and lower layer network services, e.g. HTTP, SMTP, FTP, Telnet. Presentation Layer: Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Session Layer: Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Transport Layer: Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Network Layer: network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Data Link Layer: Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. Physical Layer: defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. The 7 Protocol Layers

10 Application Layer: Interface between software and lower layer network services, e.g. HTTP, SMTP, FTP, Telnet. Presentation Layer: Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Session Layer: Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. Transport Layer: Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. Network Layer: network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Data Link Layer: Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. Physical Layer: defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. The 7 Protocol Layers

11 Application Layer: Interface between software and lower layer network services, e.g. HTTP, SMTP, FTP, Telnet. Presentation Layer: Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Session Layer: Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Transport Layer: Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. Network Layer: network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Data Link Layer: Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. Physical Layer: defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. The 7 Protocol Layers

12 Application Layer: Interface between software and lower layer network services, e.g. HTTP, SMTP, FTP, Telnet. Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Presentation Layer: Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Session Layer: Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Transport Layer: Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. Network Layer: network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Data Link Layer: Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. Physical Layer: defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. The 7 Protocol Layers

13 Application Layer: Interface between software and lower layer network services, e.g. HTTP, SMTP, FTP, Telnet. Presentation Layer: Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Session Layer: Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Transport Layer: Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. Network Layer: network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Data Link Layer: Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. Physical Layer: defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. The 7 Protocol Layers

14 Application Layer: Interface between software and lower layer network services, e.g. HTTP, SMTP, FTP, Telnet. Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Presentation Layer: Relieves Application layer from burden of managing syntactical differences in data representation (compression/encryption/formatting), e.g. ASCII/MIDI/MPEG. Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Session Layer: Managing dialogue between end-user application processes (termination/restart procedures etc.), e.g. NetBIOS Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. Transport Layer: Transparent transfer of data between end users (controls reliability), e.g. TCP, UDP, RTP. network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Network Layer: network routing, flow control, segmentation/desegmentation, and error control, e.g. IP. Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. Data Link Layer: Functional/procedural means for transferring data bridges and switches operate at this level, e.g. Ethernet. defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. Physical Layer: defines all the electrical and physical specifications for devices, e.g. hubs, ISDN, DSL, T1. The 7 Protocol Layers Taco Bell’s 7-layer Burrito

15

16 Protocols and James Bond James Bond meets No.1, who gives Bond a secret message that must get through to the US Embassy across town. 7 th FLOOR: James Bond meets No.1, who gives Bond a secret message that must get through to the US Embassy across town. 6 th FLOOR: Message is translated into an intermediary language, encrypted and miniaturized. 5 th FLOOR: Security checks the message to be sure it is all there and puts some checkpoints in the message so his counterpart at the US end can be sure he’s got the whole message. 4 th FLOOR: message is analyzed to see if it can be combined with some other small messages that need to go to the US end. If message is very large it might be broken into several small packages so other spies can take it and have it reassembled on the other end.

17 Protocols and James Bond James Bond meets No.1, who gives Bond a secret message that must get through to the US Embassy across town. 7 th FLOOR: James Bond meets No.1, who gives Bond a secret message that must get through to the US Embassy across town. Message is translated into an intermediary language, encrypted and miniaturized. 6 th FLOOR: Message is translated into an intermediary language, encrypted and miniaturized. 5 th FLOOR: Security checks the message to be sure it is all there and puts some checkpoints in the message so his counterpart at the US end can be sure he’s got the whole message. 4 th FLOOR: message is analyzed to see if it can be combined with some other small messages that need to go to the US end. If message is very large it might be broken into several small packages so other spies can take it and have it reassembled on the other end.

18 Protocols and James Bond James Bond meets No.1, who gives Bond a secret message that must get through to the US Embassy across town. 7 th FLOOR: James Bond meets No.1, who gives Bond a secret message that must get through to the US Embassy across town. Message is translated into an intermediary language, encrypted and miniaturized. 6 th FLOOR: Message is translated into an intermediary language, encrypted and miniaturized. Security checks the message to be sure it is all there and puts some checkpoints in the message so his counterpart at the US end can be sure he’s got the whole message. 5 th FLOOR: Security checks the message to be sure it is all there and puts some checkpoints in the message so his counterpart at the US end can be sure he’s got the whole message. 4 th FLOOR: message is analyzed to see if it can be combined with some other small messages that need to go to the US end. If message is very large it might be broken into several small packages so other spies can take it and have it reassembled on the other end.

19 Protocols and James Bond James Bond meets No.1, who gives Bond a secret message that must get through to the US Embassy across town. 7 th FLOOR: James Bond meets No.1, who gives Bond a secret message that must get through to the US Embassy across town. Message is translated into an intermediary language, encrypted and miniaturized. 6 th FLOOR: Message is translated into an intermediary language, encrypted and miniaturized. Security checks the message to be sure it is all there and puts some checkpoints in the message so his counterpart at the US end can be sure he’s got the whole message. 5 th FLOOR: Security checks the message to be sure it is all there and puts some checkpoints in the message so his counterpart at the US end can be sure he’s got the whole message. message is analyzed to see if it can be combined with some other small messages that need to go to the US end. If message is very large it might be broken into several small packages so other spies can take it and have it reassembled on the other end. 4 th FLOOR: message is analyzed to see if it can be combined with some other small messages that need to go to the US end. If message is very large it might be broken into several small packages so other spies can take it and have it reassembled on the other end.

20 Protocols and James Bond personnel check the address on the message and determine who the addressee is, and advises Bond of the fastest route to the Embassy. 3 rd FLOOR: personnel check the address on the message and determine who the addressee is, and advises Bond of the fastest route to the Embassy. 2 nd FLOOR: message is put into a special courier pouch (packet). It contains the message, the sender and destination ID. It also warns the recipient if other pieces are still coming. 1 st FLOOR: Q has prepared the BMW Z4 (with attractive lady companion) for trip to the Embassy. "Bond, please tell Number One I’ll be glad to meet him for dinner tonight.”

21 Protocols and James Bond personnel check the address on the message and determine who the addressee is, and advises Bond of the fastest route to the Embassy. 3 rd FLOOR: personnel check the address on the message and determine who the addressee is, and advises Bond of the fastest route to the Embassy. message is put into a special courier pouch (packet). It contains the message, the sender and destination ID. It also warns the recipient if other pieces are still coming. 2 nd FLOOR: message is put into a special courier pouch (packet). It contains the message, the sender and destination ID. It also warns the recipient if other pieces are still coming. 1 st FLOOR: Q has prepared the BMW Z4 (with attractive lady companion) for trip to the Embassy. "Bond, please tell Number One I’ll be glad to meet him for dinner tonight.”

22 Protocols and James Bond personnel check the address on the message and determine who the addressee is, and advises Bond of the fastest route to the Embassy. 3 rd FLOOR: personnel check the address on the message and determine who the addressee is, and advises Bond of the fastest route to the Embassy. message is put into a special courier pouch (packet). It contains the message, the sender and destination ID. It also warns the recipient if other pieces are still coming. 2 nd FLOOR: message is put into a special courier pouch (packet). It contains the message, the sender and destination ID. It also warns the recipient if other pieces are still coming. Q has prepared the BMW Z4 (with attractive lady companion) for trip to the Embassy. 1 st FLOOR: Q has prepared the BMW Z4 (with attractive lady companion) for trip to the Embassy. "Bond, please tell Number One I’ll be glad to meet him for dinner tonight.”

23 Protocols and James Bond personnel check the address on the message and determine who the addressee is, and advises Bond of the fastest route to the Embassy. 3 rd FLOOR: personnel check the address on the message and determine who the addressee is, and advises Bond of the fastest route to the Embassy. message is put into a special courier pouch (packet). It contains the message, the sender and destination ID. It also warns the recipient if other pieces are still coming. 2 nd FLOOR: message is put into a special courier pouch (packet). It contains the message, the sender and destination ID. It also warns the recipient if other pieces are still coming. Q has prepared the BMW Z4 (with attractive lady companion) for trip to the Embassy. 1 st FLOOR: Q has prepared the BMW Z4 (with attractive lady companion) for trip to the Embassy. "Bond, please tell Number One I’ll be glad to meet him for dinner tonight.”

24 So what is BitTorrent? An application level protocol (OSI Level 7). An application level protocol (OSI Level 7). Designed to distribute large amounts of data without consuming large server and bandwidth resources. Designed to distribute large amounts of data without consuming large server and bandwidth resources. Designed by Bram Cohen in Python, who also wrote the first BitTorrent application, and is available Open Source. Designed by Bram Cohen in Python, who also wrote the first BitTorrent application, and is available Open Source.

25 BitTorrent Speak… Common terms related to BitTorrent include: - People who download files but do not share files on their own computer with others Leeches - People who download files but do not share files on their own computer with others - A computer with a complete copy of a BitTorrent file (At least one seed computer is necessary for a BitTorrent download to operate.) Seed or seeder - A computer with a complete copy of a BitTorrent file (At least one seed computer is necessary for a BitTorrent download to operate.) - A group of computers simultaneously sending (uploading) or receiving (downloading) the same file Swarm - A group of computers simultaneously sending (uploading) or receiving (downloading) the same file - A pointer file that directs your computer to the file you want to download.torrent - A pointer file that directs your computer to the file you want to download - A server that manages the BitTorrent file-transfer process Tracker - A server that manages the BitTorrent file-transfer process

26 How BitTorrent works: STEP 1 torrent metafile hosted on a popular website: containing information about the location of the tracker and verification hashes for the pieces of the file. torrent metafile hosted on a popular website: containing information about the location of the tracker and verification hashes for the pieces of the file. User downloads torrent file. User downloads torrent file. If the.torrent association has already been made on our web browser, a click on the url of the webpage is sufficient to download it. If the.torrent association has already been made on our web browser, a click on the url of the webpage is sufficient to download it.

27 How BitTorrent works: STEP 2 Client sends a HTTP-GET request to tracker. Client sends a HTTP-GET request to tracker. The tracker is a server which accepts requests for information about other peers on network. The tracker is a server which accepts requests for information about other peers on network. GET Request advertises Peer A's Peer id, IP address and Port number to the tracker, so other peers in the network can connect with Peer A. GET Request advertises Peer A's Peer id, IP address and Port number to the tracker, so other peers in the network can connect with Peer A.

28 How BitTorrent works: STEP 3 Tracker responds with a list of peers, (ip address and port number), who are currently downloading or uploading the file. Tracker responds with a list of peers, (ip address and port number), who are currently downloading or uploading the file. Say, Peer A sees Peers B and C in the response list from the tracker. Also, as indicated, let Peer C be a seed (peer that has a complete copy of the file). Say, Peer A sees Peers B and C in the response list from the tracker. Also, as indicated, let Peer C be a seed (peer that has a complete copy of the file).

29 How BitTorrent works: STEP 4 Peer A initiates TCP connections with the peers in the peer list it obtained from the tracker. Peer A initiates TCP connections with the peers in the peer list it obtained from the tracker. Since B and C were on that list, Peer A connects to both and initiates a 3 way BitTorrent handshake. Since B and C were on that list, Peer A connects to both and initiates a 3 way BitTorrent handshake.

30 How BitTorrent works: STEP 5 Once connection has been established and remote peer has been authenticated, peers B and C advertise what pieces they already have with a message. Once connection has been established and remote peer has been authenticated, peers B and C advertise what pieces they already have with a BITFIELD message. since it does not have any pieces yet. Peer A then sends a message requesting for a particular chunk of a piece. Peer A expresses INTEREST since it does not have any pieces yet. Peer A then sends a REQUEST message requesting for a particular chunk of a piece. When the remote peers Peer A, it starts downloading from them. Initially Peer A only downloads untill it gets hold of a complete piece. When the remote peers UNCHOKE Peer A, it starts downloading from them. Initially Peer A only downloads untill it gets hold of a complete piece.

31 How BitTorrent works: STEP 6 After Peer A successfully downloads a complete piece and verifies it against the message indicating that it just got a piece. After Peer A successfully downloads a complete piece and verifies it against the hash in the.torrent file, it broadcasts HAVE message indicating that it just got a piece. If other peers are interested then they can obtain it from Peer A. Now Peer A has boot strapped into the file swarming network adn starts exchanging portions of the file with other leeches. If other peers are interested then they can obtain it from Peer A. Now Peer A has boot strapped into the file swarming network adn starts exchanging portions of the file with other leeches. Note, that Peer C is a seed and since it has a complete copy of the file, it only uploads to other leeches in the network. Note, that Peer C is a seed and since it has a complete copy of the file, it only uploads to other leeches in the network.

32 How BitTorrent works: STEP 7 Peers periodically contact tracker to discover more peers. Peers periodically contact tracker to discover more peers. These messages also act in advertising to the tracker of the peer's progress. The announce message consists of fields to indicate how much the peer has downloaded and how much is left. These ANNOUNCE messages also act in advertising to the tracker of the peer's progress. The announce message consists of fields to indicate how much the peer has downloaded and how much is left. Finally, once Peer A completes downloading the fie, it disconnects from other seeds and becomes a seed, offering the file to other leeches in the network. Finally, once Peer A completes downloading the fie, it disconnects from other seeds and becomes a seed, offering the file to other leeches in the network.

33 Traditional Client Server Downloading

34 Peer-To-Peer File Sharing Problem: Leechers simply download.

35 What BitTorrent Does BitTorrent downloads different pieces of the file you want simultaneously from multiple computers BitTorrent downloads different pieces of the file you want simultaneously from multiple computers Downloading pieces of the file at the same time helps solve a common problem with other peer-to-peer download methods: Peers upload at a much slower rate than they download.\ Downloading pieces of the file at the same time helps solve a common problem with other peer-to-peer download methods: Peers upload at a much slower rate than they download.\ Downloading multiple pieces at the same time improves overall speed. The more computers involved in the swarm, the faster the file transfer occurs because there are more sources of each piece of the file. For this reason, BitTorrent is especially useful for large, popular files. Downloading multiple pieces at the same time improves overall speed. The more computers involved in the swarm, the faster the file transfer occurs because there are more sources of each piece of the file. For this reason, BitTorrent is especially useful for large, popular files.

36 Difference between BitTorrent and HTTP/FTP etc. Contrasted with conventional file serving where high demand saturates host's resources (bandwidth) to transfer the file to many requesting downloaders. Contrasted with conventional file serving where high demand saturates host's resources (bandwidth) to transfer the file to many requesting downloaders. In BitTorrent, high demand throughput as more bandwidth and additional “seeds” of the file become available to the group. In BitTorrent, high demand INCREASES throughput as more bandwidth and additional “seeds” of the file become available to the group. Cohen claims that for very popular files, BitTorrent can support about a thousand times as many downloads as HTTP. Cohen claims that for very popular files, BitTorrent can support about a thousand times as many downloads as HTTP.

37 Legal Issues Though there remains a potential for copyright infringement, legal uses abound: BT used by different people in different ways LEGALLY: on their servers Software developers ease bandwidth strain on their servers Game sites offer Game sites offer legal game files via BitTorrent Amateur/fan films distributing film copies via BitTorrent Rock group Harvey Danger began distributing their third full-length album. Open Source software releases: including. Open Source software releases: including FreeBSD, NetBSD version 1.6.2 and later. NASA. NASA used BitTorrent to offer download of some of their larger space image files. BitTorrent is overwhelmingly the most popular P2P protocol adopted officially for legal uses. Many adopters report that only BT’s dramatically reduced demands on networking hardware and bandwidth, allows them to distribute such large files. Many adopters report that only BT’s dramatically reduced demands on networking hardware and bandwidth, allows them to distribute such large files.

38 Conclusion and Recap Protocols are the followed to enable inter-device communication. Protocols are the set of rules followed to enable inter-device communication. Protocols data (with/without reliability). Protocols establish/terminate connections and transfer data (with/without reliability). helps us understand the protocol functions as a 7-level abstracted model. OSI model helps us understand the protocol functions as a 7-level abstracted model. BitTorrent is one. BitTorrent is one application level protocol. BitTorrent protocol does not employ the traditional client-server or even the P2P methodology. Higher strain and and greater requests actually its efficiency. BitTorrent protocol does not employ the traditional client-server or even the P2P methodology. Higher strain and and greater requests actually increase its efficiency. Perfectly legal,. Perfectly legal, has several useful/legal/uses. Bram Cohen proves that the protocol’s technique is. Bram Cohen proves that the protocol’s technique is PARETO OPTIMAL.

39 Acknowledgements and Bibliography A top down approach to the Internet, Kurose and Ross (2005). Computer Networking: A top down approach to the Internet, Kurose and Ross (2005). – feature on BitTorrent. www.howstuffworks.com – feature on BitTorrent. - feature on BitTorrent www.wikipedia.com - feature on BitTorrent – OSI Model and James Bond Lewis Technology Inc. – OSI Model and James Bond


Download ppt "Vishal Nehru Computer Science 428 Understanding Network Protocols: The BitTorrent Case."

Similar presentations


Ads by Google