Gdb transport protocols
1 / 11

GDB & Transport Protocols - PowerPoint PPT Presentation

  • Uploaded on

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.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
Download Presentation

PowerPoint Slideshow about 'GDB & Transport Protocols' - kelly-bryant

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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Gdb transport protocols

GDB &Transport Protocols


Ramya Raghavendra

What is gdb
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
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
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
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
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
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
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
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

O=100KB, S=536B, RTT=100ms

  • Minimum latency = 2RTT+O/R

  • W = min{w: w >= (RTT+S/R)