SlideShare uma empresa Scribd logo
1 de 43
Baixar para ler offline
Announcements 
● Lab 1: Due Monday 12.49pm 
Late (capped at 90%) due Wed at 8.59pm 
● BUG: make submit does not include README file. See 
piazza for workaround. 
● Writing assignment: Due Sunday at 5.59pm. (8 writing 
assignments total; choose 2.)
Outline 
● Lab 1 theory 
● Lab 1 practice 
● GDB 
● Questions
Theory + Preview 
Network 
Sender Receiver
Theory + Preview 
Network 
pkt 
Sender Receiver
Theory + Preview 
Network 
pkt 
Sender Receiver 
What are all the terrible things that can happen to this 
data packet in the network?
Things that can happen to a packet 
● Corrupted 
● Dropped 
● Delayed 
● Duplicated 
What are some primitives used to address these 
problems?
Things that can happen to a packet 
● Corrupted 
● Dropped 
● Delayed 
● Duplicated 
What are some primitives used to address these 
problems? 
-Acknowledgments/retransmissions 
-Sequence numbers 
-Checksums
Original example 
Sender Receiver
Receiver's view 
● Data packet with sequence #1 arrives
Receiver's view 
● Data packet with sequence #1 arrives 
● Packet's checksum, etc. are correct
Receiver's view 
● Data packet with sequence #1 arrives 
● Packet's checksum, etc. are correct 
● Send ack for #1
Receiver's view 
● Data packet with sequence #1 arrives 
● Packet's checksum, etc. are correct 
● Send ack for #1 
● Data packet with sequence #1 arrives
Receiver's view 
● Data packet with sequence #1 arrives 
● Packet's checksum, etc. are correct 
● Send ack for #1 
● Data packet with sequence #1 arrives 
Send ack or do nothing?
Don't Send Ack 
SeqNo: #1 
X 
SeqNo: #1 
SSeeqqNNoo:: ##11 
Sender Receiver 
... 
If we do not re-send ack, can get into a case where we 
have infinite retransmissions. (Bad) 
Therefore, we should re-send the ack.
● Edge cases matter 
● Think through all states system can be in
Outline 
● Lab 1 theory 
● Lab 1 practice 
● GDB 
● Questions
A Quote 
“A professor once told me that the secret to 
teaching is that students aren't going to learn 
what you tell them during lecture. What they're 
going to learn is what you make them build 
themselves.” 
-????
A Quote 
“A professor once told me that the secret to 
teaching is that students aren't going to learn 
what you tell them during lecture. What they're 
going to learn is what you make them build 
themselves.” 
-Phil Levis
A Quote 
“A professor once told me that the secret to 
teaching is that students aren't going to learn 
what you tell them during lecture. What they're 
going to learn is what you make them build 
themselves.” 
-Phil Levis 
● Labs are a lot of work. 
● You'll get something out of them. 
● Start them early. 
● Think about them while you're working on them.
Goals of Labs 1 & 2 
● Understand edge cases for reliable transport 
and techniques for accomplishing it. 
● Get experience working with and using others' 
code.
Event-based structure 
● What are events that system needs to handle? 
● What parts of the given code map to these events? 
● How should you respond to each? (Generally it will 
depend on the “state” that you are in.) 
● How do you track what state you are in? How do you 
change states?
Events 
● Receive data packet 
● Receive ack packet 
● Input goes from empty to having data 
● Output goes from full to having room 
● Timer expires 
● Create a new connection 
------ 
● Receive shutdown from opposite end 
● Receive shutdown from input
Event-based structure 
X 
● What are events that system needs to handle? 
● What parts of the given code map to these events? 
● How should you respond to each? (Generally it will 
depend on the “state” that you are in.) 
● How do you track what state you are in? How do you 
change states?
Events 
● Create a new connection 
rel_create 
● Receive data packet 
● Receive ack packet 
rel_recvpkt 
● Input goes from empty to having data 
rel_read 
● Output goes from full to having room 
rel_output 
● Timer expires 
rel_timer
Event-based structure 
X 
X 
● What are events that system needs to handle? 
● What parts of the given code map to these events? 
● How should you respond to each? (Generally it will 
depend on the “state” that you are in.) 
● How do you track what state you are in? How do you 
change states?
Events 
● Create a new connection 
rel_create 
● Receive data packet 
● Receive ack packet 
rel_recvpkt 
● Input goes from empty to having data 
rel_read 
● Output goes from full to having room 
rel_output 
● Timer expires 
rel_timer
Timer expires
Timer expires 
● Timer expiration maps to retransmits. 
● When do we retransmit? 
– Have an unacknowledged packet in flight and 
– We sent it more than cc­> 
timeout milliseconds ago. 
(Where cc is of type config_common* .)
Timer expires 
for conn in openConnections: 
if ((conn.hasUnackedPkt) and 
(conn.timeSinceSentPkt > THRESHOLD)) 
{ 
resend(conn.unackedPkt); 
}
Timer expires 
for conn in openConnections: 
if ((conn.hasUnackedPkt) and 
(conn.timeSinceSentPkt > THRESHOLD)) 
{ 
resend(conn.unackedPkt); 
} 
“Style” grade is 25% of lab score.
Receive data packet
Receive data packet 
● Sanity checks 
● Is it the right length? 
● Does its checksum match? 
● Has the other end already sent a stream close 
packet? 
● Are you expecting the sequence number?
Receive data packet 
● Sanity checks 
● Is it the right length? 
● Does its checksum match? 
● Has the other end already sent a stream close 
packet? 
● Are you expecting the sequence number? 
----------- 
● Should you send an ack? 
● Should you output to client?
Gotchas 
● htons, htonl, ntohs, ntohl 
● cksum 
● When to call conn_input
htons & ntohs 
● How do I write the number 512?
htons & ntohs 
● How do I write the number 512? 
Hint: 512 = 2^9.
htons & ntohs 
● How do I write the number 512? 
Hint: 512 = 2^9. 
Binary: 1000000000 
Hex: 200
htons & ntohs 
● How do I write the number 512? 
Hint: 512 = 2^9. 
Binary: 1000000000 
Hex: 200 
MSB LSB
htons & ntohs 
● How do I write the number 512? 
Hint: 512 = 2^9. 
Binary: 1000000000 
Hex: 200 
MSB LSB 
Should a machine store this as or ?
htons & ntohs 
● How do I write the number 512? 
Hint: 512 = 2^9. 
Binary: 1000000000 
Hex: 200 
MSB LSB 
Big-endian 
Network byte order 
Little-endian 
Should a machine store this as or ?
htons & ntohs 
● If your host is little-endian: 
ntohs( ) 
htons( ) 
● If your host is big-endian: 
ntohs( ) 
htons( )
htonl & ntohl 
● If your host is little-endian: 
ntohl( ) 
htonl( ) 
● If your host is big-endian: 
ntohl( ) 
htonl( )
Outline 
● Lab 1 theory 
● Lab 1 practice 
● GDB 
● Questions

Mais conteúdo relacionado

Mais procurados

Scalable concurrency control in a dynamic membership
Scalable concurrency control  in a dynamic membershipScalable concurrency control  in a dynamic membership
Scalable concurrency control in a dynamic membership
Augusto Ciuffoletti
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
koolkampus
 

Mais procurados (20)

A simple tool for debug (tap>)
A simple tool for debug (tap>)A simple tool for debug (tap>)
A simple tool for debug (tap>)
 
Paxos building-reliable-system
Paxos building-reliable-systemPaxos building-reliable-system
Paxos building-reliable-system
 
rspamd-fosdem
rspamd-fosdemrspamd-fosdem
rspamd-fosdem
 
Grokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applicationsGrokking Techtalk #39: Gossip protocol and applications
Grokking Techtalk #39: Gossip protocol and applications
 
Design of a secure "Token Passing" protocol
Design of a secure "Token Passing" protocolDesign of a secure "Token Passing" protocol
Design of a secure "Token Passing" protocol
 
Long Short Term Memory (Neural Networks)
Long Short Term Memory (Neural Networks)Long Short Term Memory (Neural Networks)
Long Short Term Memory (Neural Networks)
 
Locking base concurrency control
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency control
 
Lstm
LstmLstm
Lstm
 
Chord
ChordChord
Chord
 
Scalable concurrency control in a dynamic membership
Scalable concurrency control  in a dynamic membershipScalable concurrency control  in a dynamic membership
Scalable concurrency control in a dynamic membership
 
SCP
SCPSCP
SCP
 
Practical Byzantine Fault Tolernace
Practical Byzantine Fault TolernacePractical Byzantine Fault Tolernace
Practical Byzantine Fault Tolernace
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neeti
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMS
 
Cryptography and secure systems
Cryptography and secure systemsCryptography and secure systems
Cryptography and secure systems
 
What could possibly go wrong
What could possibly go wrongWhat could possibly go wrong
What could possibly go wrong
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm Confirmations
 
erlang 101
erlang 101erlang 101
erlang 101
 
Concurrency control!
Concurrency control!Concurrency control!
Concurrency control!
 

Semelhante a Computer network (8)

Scala like distributed collections - dumping time-series data with apache spark
Scala like distributed collections - dumping time-series data with apache sparkScala like distributed collections - dumping time-series data with apache spark
Scala like distributed collections - dumping time-series data with apache spark
Demi Ben-Ari
 
Kafka Connect: Operational Lessons Learned from the Trenches (Elizabeth Benne...
Kafka Connect: Operational Lessons Learned from the Trenches (Elizabeth Benne...Kafka Connect: Operational Lessons Learned from the Trenches (Elizabeth Benne...
Kafka Connect: Operational Lessons Learned from the Trenches (Elizabeth Benne...
confluent
 
Verifying offchain computations using TrueBit. Sami Makela
Verifying offchain computations using TrueBit. Sami MakelaVerifying offchain computations using TrueBit. Sami Makela
Verifying offchain computations using TrueBit. Sami Makela
Cyber Fund
 
Keynote: Building and Operating A Serverless Streaming Runtime for Apache Bea...
Keynote: Building and Operating A Serverless Streaming Runtime for Apache Bea...Keynote: Building and Operating A Serverless Streaming Runtime for Apache Bea...
Keynote: Building and Operating A Serverless Streaming Runtime for Apache Bea...
Flink Forward
 
Mininet: Moving Forward
Mininet: Moving ForwardMininet: Moving Forward
Mininet: Moving Forward
ON.Lab
 

Semelhante a Computer network (8) (20)

Building real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark StreamingBuilding real time Data Pipeline using Spark Streaming
Building real time Data Pipeline using Spark Streaming
 
Beyond the DSL-Unlocking the Power of Kafka Streams with the Processor API (A...
Beyond the DSL-Unlocking the Power of Kafka Streams with the Processor API (A...Beyond the DSL-Unlocking the Power of Kafka Streams with the Processor API (A...
Beyond the DSL-Unlocking the Power of Kafka Streams with the Processor API (A...
 
What Your Tech Lead Thinks You Know (But Didn't Teach You)
What Your Tech Lead Thinks You Know (But Didn't Teach You)What Your Tech Lead Thinks You Know (But Didn't Teach You)
What Your Tech Lead Thinks You Know (But Didn't Teach You)
 
Scala like distributed collections - dumping time-series data with apache spark
Scala like distributed collections - dumping time-series data with apache sparkScala like distributed collections - dumping time-series data with apache spark
Scala like distributed collections - dumping time-series data with apache spark
 
Kafka Connect: Operational Lessons Learned from the Trenches (Elizabeth Benne...
Kafka Connect: Operational Lessons Learned from the Trenches (Elizabeth Benne...Kafka Connect: Operational Lessons Learned from the Trenches (Elizabeth Benne...
Kafka Connect: Operational Lessons Learned from the Trenches (Elizabeth Benne...
 
How to build TiDB
How to build TiDBHow to build TiDB
How to build TiDB
 
System integration through queues
System integration through queuesSystem integration through queues
System integration through queues
 
Concurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papersConcurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papers
 
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
Big Data Day LA 2016/ Big Data Track - Portable Stream and Batch Processing w...
 
Verifying offchain computations using TrueBit. Sami Makela
Verifying offchain computations using TrueBit. Sami MakelaVerifying offchain computations using TrueBit. Sami Makela
Verifying offchain computations using TrueBit. Sami Makela
 
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...S3, Cassandra or Outer Space? Dumping Time Series Data using Spark  - Demi Be...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Be...
 
Beyond the DSL - Unlocking the power of Kafka Streams with the Processor API
Beyond the DSL - Unlocking the power of Kafka Streams with the Processor APIBeyond the DSL - Unlocking the power of Kafka Streams with the Processor API
Beyond the DSL - Unlocking the power of Kafka Streams with the Processor API
 
Keynote: Building and Operating A Serverless Streaming Runtime for Apache Bea...
Keynote: Building and Operating A Serverless Streaming Runtime for Apache Bea...Keynote: Building and Operating A Serverless Streaming Runtime for Apache Bea...
Keynote: Building and Operating A Serverless Streaming Runtime for Apache Bea...
 
Mininet: Moving Forward
Mininet: Moving ForwardMininet: Moving Forward
Mininet: Moving Forward
 
Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17Series of Unfortunate Netflix Container Events - QConNYC17
Series of Unfortunate Netflix Container Events - QConNYC17
 
Flink Forward Berlin 2018: Lasse Nedergaard - "Our successful journey with Fl...
Flink Forward Berlin 2018: Lasse Nedergaard - "Our successful journey with Fl...Flink Forward Berlin 2018: Lasse Nedergaard - "Our successful journey with Fl...
Flink Forward Berlin 2018: Lasse Nedergaard - "Our successful journey with Fl...
 
Retaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingRetaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate Limiting
 
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
Kubernetes @ Squarespace (SRE Portland Meetup October 2017)
 
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Ben...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Ben...S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Ben...
S3, Cassandra or Outer Space? Dumping Time Series Data using Spark - Demi Ben...
 
Stripe CTF3 wrap-up
Stripe CTF3 wrap-upStripe CTF3 wrap-up
Stripe CTF3 wrap-up
 

Mais de NYversity

Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1
NYversity
 
3016 all-2007-dist
3016 all-2007-dist3016 all-2007-dist
3016 all-2007-dist
NYversity
 
Programming methodology lecture28
Programming methodology lecture28Programming methodology lecture28
Programming methodology lecture28
NYversity
 
Programming methodology lecture27
Programming methodology lecture27Programming methodology lecture27
Programming methodology lecture27
NYversity
 
Programming methodology lecture26
Programming methodology lecture26Programming methodology lecture26
Programming methodology lecture26
NYversity
 
Programming methodology lecture25
Programming methodology lecture25Programming methodology lecture25
Programming methodology lecture25
NYversity
 
Programming methodology lecture24
Programming methodology lecture24Programming methodology lecture24
Programming methodology lecture24
NYversity
 
Programming methodology lecture23
Programming methodology lecture23Programming methodology lecture23
Programming methodology lecture23
NYversity
 
Programming methodology lecture22
Programming methodology lecture22Programming methodology lecture22
Programming methodology lecture22
NYversity
 
Programming methodology lecture20
Programming methodology lecture20Programming methodology lecture20
Programming methodology lecture20
NYversity
 
Programming methodology lecture19
Programming methodology lecture19Programming methodology lecture19
Programming methodology lecture19
NYversity
 
Programming methodology lecture18
Programming methodology lecture18Programming methodology lecture18
Programming methodology lecture18
NYversity
 
Programming methodology lecture17
Programming methodology lecture17Programming methodology lecture17
Programming methodology lecture17
NYversity
 
Programming methodology lecture16
Programming methodology lecture16Programming methodology lecture16
Programming methodology lecture16
NYversity
 
Programming methodology lecture15
Programming methodology lecture15Programming methodology lecture15
Programming methodology lecture15
NYversity
 
Programming methodology lecture14
Programming methodology lecture14Programming methodology lecture14
Programming methodology lecture14
NYversity
 
Programming methodology lecture13
Programming methodology lecture13Programming methodology lecture13
Programming methodology lecture13
NYversity
 
Programming methodology lecture12
Programming methodology lecture12Programming methodology lecture12
Programming methodology lecture12
NYversity
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11
NYversity
 
Programming methodology lecture10
Programming methodology lecture10Programming methodology lecture10
Programming methodology lecture10
NYversity
 

Mais de NYversity (20)

Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1
 
3016 all-2007-dist
3016 all-2007-dist3016 all-2007-dist
3016 all-2007-dist
 
Programming methodology lecture28
Programming methodology lecture28Programming methodology lecture28
Programming methodology lecture28
 
Programming methodology lecture27
Programming methodology lecture27Programming methodology lecture27
Programming methodology lecture27
 
Programming methodology lecture26
Programming methodology lecture26Programming methodology lecture26
Programming methodology lecture26
 
Programming methodology lecture25
Programming methodology lecture25Programming methodology lecture25
Programming methodology lecture25
 
Programming methodology lecture24
Programming methodology lecture24Programming methodology lecture24
Programming methodology lecture24
 
Programming methodology lecture23
Programming methodology lecture23Programming methodology lecture23
Programming methodology lecture23
 
Programming methodology lecture22
Programming methodology lecture22Programming methodology lecture22
Programming methodology lecture22
 
Programming methodology lecture20
Programming methodology lecture20Programming methodology lecture20
Programming methodology lecture20
 
Programming methodology lecture19
Programming methodology lecture19Programming methodology lecture19
Programming methodology lecture19
 
Programming methodology lecture18
Programming methodology lecture18Programming methodology lecture18
Programming methodology lecture18
 
Programming methodology lecture17
Programming methodology lecture17Programming methodology lecture17
Programming methodology lecture17
 
Programming methodology lecture16
Programming methodology lecture16Programming methodology lecture16
Programming methodology lecture16
 
Programming methodology lecture15
Programming methodology lecture15Programming methodology lecture15
Programming methodology lecture15
 
Programming methodology lecture14
Programming methodology lecture14Programming methodology lecture14
Programming methodology lecture14
 
Programming methodology lecture13
Programming methodology lecture13Programming methodology lecture13
Programming methodology lecture13
 
Programming methodology lecture12
Programming methodology lecture12Programming methodology lecture12
Programming methodology lecture12
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11
 
Programming methodology lecture10
Programming methodology lecture10Programming methodology lecture10
Programming methodology lecture10
 

Último

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Último (20)

Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Tatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf artsTatlong Kwento ni Lola basyang-1.pdf arts
Tatlong Kwento ni Lola basyang-1.pdf arts
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 

Computer network (8)

  • 1. Announcements ● Lab 1: Due Monday 12.49pm Late (capped at 90%) due Wed at 8.59pm ● BUG: make submit does not include README file. See piazza for workaround. ● Writing assignment: Due Sunday at 5.59pm. (8 writing assignments total; choose 2.)
  • 2. Outline ● Lab 1 theory ● Lab 1 practice ● GDB ● Questions
  • 3. Theory + Preview Network Sender Receiver
  • 4. Theory + Preview Network pkt Sender Receiver
  • 5. Theory + Preview Network pkt Sender Receiver What are all the terrible things that can happen to this data packet in the network?
  • 6. Things that can happen to a packet ● Corrupted ● Dropped ● Delayed ● Duplicated What are some primitives used to address these problems?
  • 7. Things that can happen to a packet ● Corrupted ● Dropped ● Delayed ● Duplicated What are some primitives used to address these problems? -Acknowledgments/retransmissions -Sequence numbers -Checksums
  • 9. Receiver's view ● Data packet with sequence #1 arrives
  • 10. Receiver's view ● Data packet with sequence #1 arrives ● Packet's checksum, etc. are correct
  • 11. Receiver's view ● Data packet with sequence #1 arrives ● Packet's checksum, etc. are correct ● Send ack for #1
  • 12. Receiver's view ● Data packet with sequence #1 arrives ● Packet's checksum, etc. are correct ● Send ack for #1 ● Data packet with sequence #1 arrives
  • 13. Receiver's view ● Data packet with sequence #1 arrives ● Packet's checksum, etc. are correct ● Send ack for #1 ● Data packet with sequence #1 arrives Send ack or do nothing?
  • 14. Don't Send Ack SeqNo: #1 X SeqNo: #1 SSeeqqNNoo:: ##11 Sender Receiver ... If we do not re-send ack, can get into a case where we have infinite retransmissions. (Bad) Therefore, we should re-send the ack.
  • 15. ● Edge cases matter ● Think through all states system can be in
  • 16. Outline ● Lab 1 theory ● Lab 1 practice ● GDB ● Questions
  • 17. A Quote “A professor once told me that the secret to teaching is that students aren't going to learn what you tell them during lecture. What they're going to learn is what you make them build themselves.” -????
  • 18. A Quote “A professor once told me that the secret to teaching is that students aren't going to learn what you tell them during lecture. What they're going to learn is what you make them build themselves.” -Phil Levis
  • 19. A Quote “A professor once told me that the secret to teaching is that students aren't going to learn what you tell them during lecture. What they're going to learn is what you make them build themselves.” -Phil Levis ● Labs are a lot of work. ● You'll get something out of them. ● Start them early. ● Think about them while you're working on them.
  • 20. Goals of Labs 1 & 2 ● Understand edge cases for reliable transport and techniques for accomplishing it. ● Get experience working with and using others' code.
  • 21. Event-based structure ● What are events that system needs to handle? ● What parts of the given code map to these events? ● How should you respond to each? (Generally it will depend on the “state” that you are in.) ● How do you track what state you are in? How do you change states?
  • 22. Events ● Receive data packet ● Receive ack packet ● Input goes from empty to having data ● Output goes from full to having room ● Timer expires ● Create a new connection ------ ● Receive shutdown from opposite end ● Receive shutdown from input
  • 23. Event-based structure X ● What are events that system needs to handle? ● What parts of the given code map to these events? ● How should you respond to each? (Generally it will depend on the “state” that you are in.) ● How do you track what state you are in? How do you change states?
  • 24. Events ● Create a new connection rel_create ● Receive data packet ● Receive ack packet rel_recvpkt ● Input goes from empty to having data rel_read ● Output goes from full to having room rel_output ● Timer expires rel_timer
  • 25. Event-based structure X X ● What are events that system needs to handle? ● What parts of the given code map to these events? ● How should you respond to each? (Generally it will depend on the “state” that you are in.) ● How do you track what state you are in? How do you change states?
  • 26. Events ● Create a new connection rel_create ● Receive data packet ● Receive ack packet rel_recvpkt ● Input goes from empty to having data rel_read ● Output goes from full to having room rel_output ● Timer expires rel_timer
  • 28. Timer expires ● Timer expiration maps to retransmits. ● When do we retransmit? – Have an unacknowledged packet in flight and – We sent it more than cc­> timeout milliseconds ago. (Where cc is of type config_common* .)
  • 29. Timer expires for conn in openConnections: if ((conn.hasUnackedPkt) and (conn.timeSinceSentPkt > THRESHOLD)) { resend(conn.unackedPkt); }
  • 30. Timer expires for conn in openConnections: if ((conn.hasUnackedPkt) and (conn.timeSinceSentPkt > THRESHOLD)) { resend(conn.unackedPkt); } “Style” grade is 25% of lab score.
  • 32. Receive data packet ● Sanity checks ● Is it the right length? ● Does its checksum match? ● Has the other end already sent a stream close packet? ● Are you expecting the sequence number?
  • 33. Receive data packet ● Sanity checks ● Is it the right length? ● Does its checksum match? ● Has the other end already sent a stream close packet? ● Are you expecting the sequence number? ----------- ● Should you send an ack? ● Should you output to client?
  • 34. Gotchas ● htons, htonl, ntohs, ntohl ● cksum ● When to call conn_input
  • 35. htons & ntohs ● How do I write the number 512?
  • 36. htons & ntohs ● How do I write the number 512? Hint: 512 = 2^9.
  • 37. htons & ntohs ● How do I write the number 512? Hint: 512 = 2^9. Binary: 1000000000 Hex: 200
  • 38. htons & ntohs ● How do I write the number 512? Hint: 512 = 2^9. Binary: 1000000000 Hex: 200 MSB LSB
  • 39. htons & ntohs ● How do I write the number 512? Hint: 512 = 2^9. Binary: 1000000000 Hex: 200 MSB LSB Should a machine store this as or ?
  • 40. htons & ntohs ● How do I write the number 512? Hint: 512 = 2^9. Binary: 1000000000 Hex: 200 MSB LSB Big-endian Network byte order Little-endian Should a machine store this as or ?
  • 41. htons & ntohs ● If your host is little-endian: ntohs( ) htons( ) ● If your host is big-endian: ntohs( ) htons( )
  • 42. htonl & ntohl ● If your host is little-endian: ntohl( ) htonl( ) ● If your host is big-endian: ntohl( ) htonl( )
  • 43. Outline ● Lab 1 theory ● Lab 1 practice ● GDB ● Questions