1 / 11

GDB & Transport Protocols

GDB & Transport Protocols. CS176A Ramya Raghavendra. What is Gdb?. GDB is the GNU Project debugger Gdb provides some helpful functionality Allows you to stop your program at any given point. You can examine the state of your program when it’s stopped.

Télécharger la présentation

GDB & Transport Protocols

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. GDB &Transport Protocols CS176A Ramya Raghavendra

  2. What is Gdb? • GDB is the GNU Project debugger • Gdb provides some helpful functionality • Allows you to stop your program at any given point. • You can examine the state of your program when it’s stopped. • Change things in your program, so you can experiment with correcting the effects of a bug. • Also a command-line program • Is also available on spinlock/coredump

  3. Using Gdb: • To start gdb with your hello program type: gdb HelloProg • When gdb starts, your program is not actually running. • You have to use the run command to start execution. • Before you do that, you should place some break points. • Once you hit a break point, you can examine any variable.

  4. Useful gdb commands • runcommand-line-arguments • Begin execution of your program with arguments • break place • place can be the name of a function or a line number • For example: break main will stop execution at the first instruction of your program • delete N • Removes breakpoints, where N is the number of the breakpoint • step • Executes current instruction and stops on the next one

  5. Gdb commands cont. • next • Same as step except this doesn’t step into functions • printE • Prints the value of any variable in your program when you are at a breakpoint, where E is the name of the variable you want to print • helpcommand • Gives you more information about any command or all if you leave out command • quit • Exit gdb

  6. GDB Basics • How to setup the environment to dump core files: • csil% ulimit –c unlimited • How to open a core file • csil% gdb –q ./executable corename (the parameter –q is optional. The will prevent GDB from printing out extra garbage when it initially loads) • What to do when a core file is loaded up • (gdb) bt (backtrace) • Will show you the stack when the program crashed • More useful to run your program with GDB. • csil% gdb –q ./executable • Set breakpoints: (gdb) b <line number> OR b <function name> • Run the program: (gdb) r <commandline params> • The program will break when it reaches a breakpoint • Print value of a variable: (gdb) print <variable name> • Step through a function: (gdb) s • Skip to the next instruction: (gdb) n • Continue until the program exits or another breakpoint is reached: (gdb) c

  7. Transport Protocols • NAK only • x-1, x+1 => x was missed • NAK is sent for x • GBN (Go Back N) • Sender is allowed to transmit multiple packets • No more than N unACKed packets in pipeline

  8. GBN(Cont) • [0,base-1] – already transmitted and ACKd • [base,nextseqnum-1] - sent, not ACKd • [nextseqnum,base+N-1] – can be sent next • >base+N+1 – cant be used • Problem 2: receiver has received k-1 • Sender got ACKS for all • Sender did not get any ACK

  9. Sample RTT • SampleRTT – time between the segment is sent and ACK is received • Estimated for every transmitted and unACKed segment • NOT for retrasmitted packets. WHY? • P1 – no ACK • P2 - ACK

  10. Fast Retrasmit • Timeout triggered retransmissions : delay • Duplicate ACK • Packet already has been ACKed • n,n+1,n+2 : sent Sent Recv ACK n n n n+1 --- n+2 n+2 n

  11. O=100KB, S=536B, RTT=100ms • Minimum latency = 2RTT+O/R • W = min{w: w >= (RTT+S/R) ------------------------- S/R

More Related