Need Help in Programming

This is a discussion on Need Help in Programming within the C Programming forums, part of the General Programming Boards category; Hello all - I have to create a program in C - I have very less experience in C. Could ...

  1. #1
    Registered User
    Join Date
    Feb 2009
    Posts
    21

    Need Help in Programming

    Hello all - I have to create a program in C - I have very less experience in C. Could somebody help me in writing this program?

    Here are the details:-

    Suppose N stations are waiting for another packet to finish on an Ethernet.
    All transmit at once when the other packet is finished, and collide. Write a
    program to simulate the continuation of these attempts, and to determine how
    long it takes before one succeeds. Make the following simplifications: ignore
    interframe spacing, ignore variability in collision times (so that
    retransmission is always after an exact integral multiple of the 51.2microsec
    slot time), and assume that each collision uses up exactly one slot time.
    Model the time, T, in units of slot times, so a collision at time T followed
    by a backoff of k=0 would result in a retransmission attempt at time T+1.

    Find out the average delay for N=20, N=40, N=100, and maybe some larger values
    too. Do your data support the notion that the delay is linear in N? (It should.)

    I appreciate any guidlines or help.

    Thanks

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,167

  3. #3
    Registered User
    Join Date
    Feb 2009
    Posts
    21
    Sorry - if I have annoyed or disregard any policy.

    What I want somebody to guide me the process or steps which needs to be taken to code this problem. I want to do coding of my own but need a way to start.

    Once again my apology.

    Regards-

  4. #4
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    Quote Originally Posted by namasteall2000 View Post
    Sorry - if I have annoyed or disregard any policy.

    What I want somebody to guide me the process or steps which needs to be taken to code this problem. I want to do coding of my own but need a way to start.

    Once again my apology.

    Regards-
    Your problem is an interesting one however, I think you should specify the mathematical relationships between all these variables. Because I, for one, don't know them.

    If I don't have enough info to do it by hand, I can't code it up for the computer. (almost always true).

    Show us how you'd do this by hand in an example. Then we'll be able to figure out how it could be done algorithmically, by the computer. Hopefully.

  5. #5
    a newbie :p
    Join Date
    Aug 2008
    Location
    Zurich, Switzerland, Switzerland
    Posts
    90
    sound complicated....
    what is it?
    udp?

  6. #6
    Registered User
    Join Date
    Feb 2009
    Posts
    21
    I have just this information - this is given in our networking book - no other information is specified. This is in the link layer chapter where we are covering ethernet etc.

  7. #7
    a newbie :p
    Join Date
    Aug 2008
    Location
    Zurich, Switzerland, Switzerland
    Posts
    90
    wow...
    beyond my imagination...
    guess need to learn more...

    good luck dude..

  8. #8
    Registered User
    Join Date
    Sep 2006
    Posts
    8,868
    The math info we'd need is in your original post - I just don't have much of a handle on the words they're using, and don't want to sit down and work it out.

    I'm not a math whiz!

    I thought you might be, however. You should at least know the terms, and thus have a start on this enumeration

    Show how you'd do this for one example, by hand. If you can't do that, you can't program a computer to do it, either.

    Otherwise it looks like you're just saying "here's my assignment, please show me the program that will solve it."

    And I won't do that. That's your load to carry.

  9. #9
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,417
    for ( T = 0 ; T < someLimit ; T++ )

    At each T, you decide
    - which of the N stations is able to transmit.
    - and some other stuff which I thought might be giving the game away
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  10. #10
    Registered User
    Join Date
    Feb 2009
    Posts
    21
    Salem - thanks for the reply.

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21