• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Ntvu

How often do IP addresses change?

9 posts in this topic

I was considering checking only the user agent string to prevent session hijacking, but I was thinking that maybe that would be a bit insecure. If an attacker had the same user agent string as another user then he could easily compromise his session. So, I'm thinking of verifying the IP address. I do know that they change quite often though. My IP addresses changes about every hour and the first set of numbers changes every few hours. Do you think it would be better to just check the first set? For example, if a user's IP changed from 128.10.10.2 to 128.97.62.50 then it would still be valid. Or should I check for the first two sets of numbers? I'm not sure how to approach this. I want as much security as possible for user sessions but I also don't want users to be logged out when they're doing something important, just because their IP address changes and invalidates their session. My question: How often do IP addresses change, and how should I approach this problem?
0

Share this post


Link to post
Share on other sites
A user's IP address is not a reliable identifier, period. Even if you did it by block (which if done, would be done by proper netmasking after you do a whois to see who owns the IP), people will login from different computers/networks.

Authentication is hard to do right. Take an established package, and use that.
0

Share this post


Link to post
Share on other sites
Telastyn is right. If you're worried about session hijacking, find a reputable session authentication package and incorporate it into your project. Security is hard, and what's worse, it's very easy for a non-expert to think that his home-made system is secure when in fact it isn't.
0

Share this post


Link to post
Share on other sites
As far as I know web session can not be hijacked, if it can, its more likely a bug in the web server. The only possible ways to hijack session is to:
a) Use packet sniffer
b) Force the user to share his session data (methods like XSS).

About IP change, I don't know how it is going on other countries but at mine we can have either dynamic or static IP. For home users dynamic IP allocated every time you dial the net, and static IPs given for period of 3 days I think.
0

Share this post


Link to post
Share on other sites
Ugh, a quick summary of IPv4 addressing, which while not complete is probably better than the guesswork shown so far.

IP Addresses are sold in blocks. "low" addresses (001-126.*.*.* iirc) were very large blocks. These were originally allocated mostly to universities and large businesses (3.*.*.* is General Electric for example). Smaller blocks (128.1.*.* to 191.254.*.* and then 192.1.1.* to 223.254.254.*) are later numbers, generally decreasing in size as demand historically increased.

The blocks generally do not change. Originally, a company (or ISP) would buy a range of IP addresses and divvy them out to computers/subscribers as they got them. These are your traditional static IPs. They're set to a network interface, and stay there until unset.

As the internet exploded, the number of addresses compared to computers has become a problem. Even the simple process of divvying a pool of addresses became a burden. Dynamic addressing was viewed as a partial solution to these. Even if a ISP has tons of customers, only a fraction of them are online at any given time. So a protocol was developed to essentially ask a server for an IP from a pool of available addresses, and then set the IP with the response.

There is also timeouts involved that will cause the computer to re-acquire an IP every so often (~8 hours is probably average. I've seen as long as a week or as little as 2 hours). Often, you'll get the same IP. If you reboot, you'll usually get a new one (though some dynamic IP servers will try to give the same computer the same IP if they can).


Something else to consider is Network Address Translation (hereafter, NAT). Even dynamic addressing wasn't enough to make enough addresses for everyone that wanted them. As such NAT has become more common. What it does is hide a bunch of computers behind a single internet visible IP. This is very common at businesses, and for home networks. The internet visible IP may be static or may be dynamic. It does tend to be more consistent, but can represent a vast number of physical users 'hidden' behind it.


These days, most game playing users will probably be behind a NAT on a infrequently changing dynamic IP. Some standard home router on a standard cable modem/DSL service that only changes IPs when the cablemodem is powered off or the ISP does maintenance. But they'll also often login from a friends' machine, or from a laptop on a random wifi network, or from work... all of which will provide a different source IP for the user.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by Telastyn
Ugh, a quick summary of IPv4 addressing, which while not complete is probably better than the guesswork shown so far.

IP Addresses are sold in blocks. "low" addresses (001-126.*.*.* iirc) were very large blocks. These were originally allocated mostly to universities and large businesses (3.*.*.* is General Electric for example). Smaller blocks (128.1.*.* to 191.254.*.* and then 192.1.1.* to 223.254.254.*) are later numbers, generally decreasing in size as demand historically increased.

What you're talking about there is called classful addressing, and it hasn't been used in a VERY long time. Now days blocks of IPs can be sold from any range (excluding reserved ranges) in any length denomination provided it fits within a traditional subnet mask format (CIDR). That means one could purchase a 15.2.4.0/10 range for instance. A lot of previous "class A" and "class B" address ranges were purchased back (or aquired using other means) from the companies that held them and repurposed after CIDR was implemented.
0

Share this post


Link to post
Share on other sites
Quite true. I did not emphasize the past tense of that arrangement enough in rereading.
0

Share this post


Link to post
Share on other sites
Quote:
Original post by s.kwee
and static IPs given for period of 3 days I think.

Static IPs are permanent, and will not change as long as you have a valid contract with your ISP. That's why they are called static :)
0

Share this post


Link to post
Share on other sites
Quote:
Original post by s.kwee
As far as I know web session can not be hijacked, if it can, its more likely a bug in the web server. The only possible ways to hijack session is to:
a) Use packet sniffer
b) Force the user to share his session data (methods like XSS).

About IP change, I don't know how it is going on other countries but at mine we can have either dynamic or static IP. For home users dynamic IP allocated every time you dial the net, and static IPs given for period of 3 days I think.


That would suck for google and ebay and whatnot if their IP's changed every few days.

static means unchanging or fixed in this context
0

Share this post


Link to post
Share on other sites
Quote:
Original post by s.kwee
As far as I know web session can not be hijacked, if it can, its more likely a bug in the web server. The only possible ways to hijack session is to:
a) Use packet sniffer
b) Force the user to share his session data (methods like XSS).

c) Guess the user's session ID (possibly trivial due to said bugs)
d) Trick the user into using a pre-arranged session ID - e.g. via links in spam emails (PHP websites allow the user to choose their own session ID by default...)
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0