A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
tcp-option-winscale.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2011 Adrian Sai-wah Tam
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
18
* Documentation, test cases: Natale Patriciello <natale.patriciello@gmail.com>
19
*/
20
21
#ifndef TCP_OPTION_WINSCALE_H
22
#define TCP_OPTION_WINSCALE_H
23
24
#include "
tcp-option.h
"
25
26
namespace
ns3
27
{
28
29
/**
30
* \ingroup tcp
31
*
32
* \brief Defines the TCP option of kind 3 (window scale option) as in \RFC{1323}
33
*
34
* For more efficient use of high bandwidth networks, a larger TCP window size
35
* may be used. The TCP window size field controls the flow of data and its
36
* value is limited to between 2 and 65,535 bytes.
37
*
38
* Since the size field cannot be expanded, a scaling factor is used.
39
* The TCP window scale option, as defined in \RFC{1323}, is an option used
40
* to increase the maximum window size from 65,535 bytes to 1 gigabyte.
41
* Scaling up to larger window sizes is a part of what is necessary for TCP Tuning.
42
*
43
* The window scale option is used only during the TCP 3-way handshake.
44
* The window scale value represents the number of bits to left-shift the
45
* 16-bit window size field. The window scale value can be set from 0
46
* (no shift) to 14 for each direction independently. Both sides must
47
* send the option in their SYN segments to enable window scaling in
48
* either direction.
49
*/
50
class
TcpOptionWinScale
:
public
TcpOption
51
{
52
public
:
53
/**
54
* \brief Get the type ID.
55
* \return the object TypeId
56
*/
57
static
TypeId
GetTypeId
();
58
TypeId
GetInstanceTypeId
()
const override
;
59
60
TcpOptionWinScale
();
61
~TcpOptionWinScale
()
override
;
62
63
void
Print
(std::ostream& os)
const override
;
64
void
Serialize
(
Buffer::Iterator
start)
const override
;
65
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
66
67
uint8_t
GetKind
()
const override
;
68
uint32_t
GetSerializedSize
()
const override
;
69
70
/**
71
* \brief Get the scale value (uint8_t)
72
* \return The scale value
73
*/
74
uint8_t
GetScale
()
const
;
75
76
/**
77
* \brief Set the scale option
78
*
79
* The scale option SHOULD be <= 14 (as \RFC{1323}).
80
*
81
* \param scale Scale factor
82
*/
83
void
SetScale
(uint8_t scale);
84
85
protected
:
86
uint8_t
m_scale
;
//!< Window scaling in number of bit shift
87
};
88
89
}
// namespace ns3
90
91
#endif
/* TCP_OPTION_WINSCALE */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition:
buffer.h:100
ns3::TcpOption
Base class for all kinds of TCP options.
Definition:
tcp-option.h:38
ns3::TcpOptionWinScale
Defines the TCP option of kind 3 (window scale option) as in RFC 1323
Definition:
tcp-option-winscale.h:51
ns3::TcpOptionWinScale::GetScale
uint8_t GetScale() const
Get the scale value (uint8_t)
Definition:
tcp-option-winscale.cc:107
ns3::TcpOptionWinScale::TcpOptionWinScale
TcpOptionWinScale()
Definition:
tcp-option-winscale.cc:32
ns3::TcpOptionWinScale::GetSerializedSize
uint32_t GetSerializedSize() const override
Returns number of bytes required for Option serialization.
Definition:
tcp-option-winscale.cc:65
ns3::TcpOptionWinScale::~TcpOptionWinScale
~TcpOptionWinScale() override
Definition:
tcp-option-winscale.cc:38
ns3::TcpOptionWinScale::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the Option to a buffer iterator.
Definition:
tcp-option-winscale.cc:71
ns3::TcpOptionWinScale::Print
void Print(std::ostream &os) const override
Print the Option contents.
Definition:
tcp-option-winscale.cc:59
ns3::TcpOptionWinScale::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the Option from a buffer iterator.
Definition:
tcp-option-winscale.cc:80
ns3::TcpOptionWinScale::SetScale
void SetScale(uint8_t scale)
Set the scale option.
Definition:
tcp-option-winscale.cc:115
ns3::TcpOptionWinScale::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition:
tcp-option-winscale.cc:53
ns3::TcpOptionWinScale::m_scale
uint8_t m_scale
Window scaling in number of bit shift.
Definition:
tcp-option-winscale.h:86
ns3::TcpOptionWinScale::GetKind
uint8_t GetKind() const override
Get the ‘kind’ (as in RFC 793) of this option.
Definition:
tcp-option-winscale.cc:101
ns3::TcpOptionWinScale::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition:
tcp-option-winscale.cc:43
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
uint32_t
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
tcp-option.h
src
internet
model
tcp-option-winscale.h
Generated on Tue May 28 2024 23:36:15 for ns-3 by
1.9.6