SlideShare une entreprise Scribd logo
1  sur  43
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

A simple tool for debug (tap>)
A simple tool for debug (tap>)A simple tool for debug (tap>)
A simple tool for debug (tap>)Laurence Chen
 
Paxos building-reliable-system
Paxos building-reliable-systemPaxos building-reliable-system
Paxos building-reliable-systemYanpo Zhang
 
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 applicationsGrokking VN
 
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" protocolAugusto Ciuffoletti
 
Long Short Term Memory (Neural Networks)
Long Short Term Memory (Neural Networks)Long Short Term Memory (Neural Networks)
Long Short Term Memory (Neural Networks)Olusola Amusan
 
Locking base concurrency control
  Locking base concurrency control  Locking base concurrency control
Locking base concurrency controlPrakash Poudel
 
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 membershipAugusto Ciuffoletti
 
Practical Byzantine Fault Tolernace
Practical Byzantine Fault TolernacePractical Byzantine Fault Tolernace
Practical Byzantine Fault TolernaceYongraeJo
 
Concurrency control ms neeti
Concurrency control ms neetiConcurrency control ms neeti
Concurrency control ms neetineeti arora
 
16. Concurrency Control in DBMS
16. Concurrency Control in DBMS16. Concurrency Control in DBMS
16. Concurrency Control in DBMSkoolkampus
 
Cryptography and secure systems
Cryptography and secure systemsCryptography and secure systems
Cryptography and secure systemsVsevolod Stakhov
 
What could possibly go wrong
What could possibly go wrongWhat could possibly go wrong
What could possibly go wrongJ On The Beach
 
Midterm Confirmations
Midterm ConfirmationsMidterm Confirmations
Midterm ConfirmationsDavid Evans
 
Concurrency control!
Concurrency control!Concurrency control!
Concurrency control!Ashish K
 

Tendances (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!
 

Similaire à Computer network (8)

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 Streamingdatamantra
 
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...confluent
 
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)Chris Riccomini
 
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 sparkDemi 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
 
How to build TiDB
How to build TiDBHow to build TiDB
How to build TiDBPingCAP
 
System integration through queues
System integration through queuesSystem integration through queues
System integration through queuesGianluca Padovani
 
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 papersSubhajit Sahu
 
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...Data Con LA
 
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 MakelaCyber Fund
 
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...Codemotion
 
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 APIconfluent
 
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 ForwardON.Lab
 
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 - QConNYC17aspyker
 
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...Flink Forward
 
Retaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingRetaining Goodput with Query Rate Limiting
Retaining Goodput with Query Rate LimitingScyllaDB
 
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)Kevin Lynch
 
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...Codemotion Tel Aviv
 
Stripe CTF3 wrap-up
Stripe CTF3 wrap-upStripe CTF3 wrap-up
Stripe CTF3 wrap-upStripe
 

Similaire à 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
 

Plus de NYversity

Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1NYversity
 
3016 all-2007-dist
3016 all-2007-dist3016 all-2007-dist
3016 all-2007-distNYversity
 
Programming methodology lecture28
Programming methodology lecture28Programming methodology lecture28
Programming methodology lecture28NYversity
 
Programming methodology lecture27
Programming methodology lecture27Programming methodology lecture27
Programming methodology lecture27NYversity
 
Programming methodology lecture26
Programming methodology lecture26Programming methodology lecture26
Programming methodology lecture26NYversity
 
Programming methodology lecture25
Programming methodology lecture25Programming methodology lecture25
Programming methodology lecture25NYversity
 
Programming methodology lecture24
Programming methodology lecture24Programming methodology lecture24
Programming methodology lecture24NYversity
 
Programming methodology lecture23
Programming methodology lecture23Programming methodology lecture23
Programming methodology lecture23NYversity
 
Programming methodology lecture22
Programming methodology lecture22Programming methodology lecture22
Programming methodology lecture22NYversity
 
Programming methodology lecture20
Programming methodology lecture20Programming methodology lecture20
Programming methodology lecture20NYversity
 
Programming methodology lecture19
Programming methodology lecture19Programming methodology lecture19
Programming methodology lecture19NYversity
 
Programming methodology lecture18
Programming methodology lecture18Programming methodology lecture18
Programming methodology lecture18NYversity
 
Programming methodology lecture17
Programming methodology lecture17Programming methodology lecture17
Programming methodology lecture17NYversity
 
Programming methodology lecture16
Programming methodology lecture16Programming methodology lecture16
Programming methodology lecture16NYversity
 
Programming methodology lecture15
Programming methodology lecture15Programming methodology lecture15
Programming methodology lecture15NYversity
 
Programming methodology lecture14
Programming methodology lecture14Programming methodology lecture14
Programming methodology lecture14NYversity
 
Programming methodology lecture13
Programming methodology lecture13Programming methodology lecture13
Programming methodology lecture13NYversity
 
Programming methodology lecture12
Programming methodology lecture12Programming methodology lecture12
Programming methodology lecture12NYversity
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11NYversity
 
Programming methodology lecture10
Programming methodology lecture10Programming methodology lecture10
Programming methodology lecture10NYversity
 

Plus 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
 

Dernier

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3JemimahLaneBuaron
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 

Dernier (20)

Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3Q4-W6-Restating Informational Text Grade 3
Q4-W6-Restating Informational Text Grade 3
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 

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