GDB & Transport Protocols

Please download to get full document.

View again

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
Information Report



Views: 13 | Pages: 0

Extension: PDF | Download: 0

Related documents
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.
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.
  • 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
  • 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.
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • Fast Retrasmit
  • Timeout triggered retransmissions : delay
  • Duplicate ACK
  • Packet already has been ACKed
  • n,n+1,n+2 : sent Sent RecvACK n n n n+1 --- n+2 n+2 n
  • O=100KB, S=536B, RTT=100ms
  • Minimum latency = 2RTT+O/R
  • W = min{w: w >= (RTT+S/R) ------------------------- S/R
  • Recommended
    View more...
    We Need Your Support
    Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

    Thanks to everyone for your continued support.

    No, Thanks