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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Adrian Sai-wah Tam <adrian.sw.tam@gmail.com>
7
* Documentation, test cases: Natale Patriciello <natale.patriciello@gmail.com>
8
*/
9
10
#ifndef TCP_OPTION_WINSCALE_H
11
#define TCP_OPTION_WINSCALE_H
12
13
#include "
tcp-option.h
"
14
15
namespace
ns3
16
{
17
18
/**
19
* \ingroup tcp
20
*
21
* \brief Defines the TCP option of kind 3 (window scale option) as in \RFC{1323}
22
*
23
* For more efficient use of high bandwidth networks, a larger TCP window size
24
* may be used. The TCP window size field controls the flow of data and its
25
* value is limited to between 2 and 65,535 bytes.
26
*
27
* Since the size field cannot be expanded, a scaling factor is used.
28
* The TCP window scale option, as defined in \RFC{1323}, is an option used
29
* to increase the maximum window size from 65,535 bytes to 1 gigabyte.
30
* Scaling up to larger window sizes is a part of what is necessary for TCP Tuning.
31
*
32
* The window scale option is used only during the TCP 3-way handshake.
33
* The window scale value represents the number of bits to left-shift the
34
* 16-bit window size field. The window scale value can be set from 0
35
* (no shift) to 14 for each direction independently. Both sides must
36
* send the option in their SYN segments to enable window scaling in
37
* either direction.
38
*/
39
class
TcpOptionWinScale
:
public
TcpOption
40
{
41
public
:
42
/**
43
* \brief Get the type ID.
44
* \return the object TypeId
45
*/
46
static
TypeId
GetTypeId
();
47
TypeId
GetInstanceTypeId
()
const override
;
48
49
TcpOptionWinScale
();
50
~TcpOptionWinScale
()
override
;
51
52
void
Print
(std::ostream& os)
const override
;
53
void
Serialize
(
Buffer::Iterator
start)
const override
;
54
uint32_t
Deserialize
(
Buffer::Iterator
start)
override
;
55
56
uint8_t
GetKind
()
const override
;
57
uint32_t
GetSerializedSize
()
const override
;
58
59
/**
60
* \brief Get the scale value (uint8_t)
61
* \return The scale value
62
*/
63
uint8_t
GetScale
()
const
;
64
65
/**
66
* \brief Set the scale option
67
*
68
* The scale option SHOULD be <= 14 (as \RFC{1323}).
69
*
70
* \param scale Scale factor
71
*/
72
void
SetScale
(uint8_t scale);
73
74
protected
:
75
uint8_t
m_scale
;
//!< Window scaling in number of bit shift
76
};
77
78
}
// namespace ns3
79
80
#endif
/* TCP_OPTION_WINSCALE */
ns3::Buffer::Iterator
iterator in a Buffer instance
Definition
buffer.h:89
ns3::TcpOption
Base class for all kinds of TCP options.
Definition
tcp-option.h:27
ns3::TcpOptionWinScale
Defines the TCP option of kind 3 (window scale option) as in RFC 1323
Definition
tcp-option-winscale.h:40
ns3::TcpOptionWinScale::GetScale
uint8_t GetScale() const
Get the scale value (uint8_t)
Definition
tcp-option-winscale.cc:96
ns3::TcpOptionWinScale::TcpOptionWinScale
TcpOptionWinScale()
Definition
tcp-option-winscale.cc:21
ns3::TcpOptionWinScale::GetSerializedSize
uint32_t GetSerializedSize() const override
Returns number of bytes required for Option serialization.
Definition
tcp-option-winscale.cc:54
ns3::TcpOptionWinScale::~TcpOptionWinScale
~TcpOptionWinScale() override
Definition
tcp-option-winscale.cc:27
ns3::TcpOptionWinScale::Serialize
void Serialize(Buffer::Iterator start) const override
Serialize the Option to a buffer iterator.
Definition
tcp-option-winscale.cc:60
ns3::TcpOptionWinScale::Print
void Print(std::ostream &os) const override
Print the Option contents.
Definition
tcp-option-winscale.cc:48
ns3::TcpOptionWinScale::Deserialize
uint32_t Deserialize(Buffer::Iterator start) override
Deserialize the Option from a buffer iterator.
Definition
tcp-option-winscale.cc:69
ns3::TcpOptionWinScale::SetScale
void SetScale(uint8_t scale)
Set the scale option.
Definition
tcp-option-winscale.cc:104
ns3::TcpOptionWinScale::GetInstanceTypeId
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition
tcp-option-winscale.cc:42
ns3::TcpOptionWinScale::m_scale
uint8_t m_scale
Window scaling in number of bit shift.
Definition
tcp-option-winscale.h:75
ns3::TcpOptionWinScale::GetKind
uint8_t GetKind() const override
Get the ‘kind’ (as in RFC 793 ) of this option.
Definition
tcp-option-winscale.cc:90
ns3::TcpOptionWinScale::GetTypeId
static TypeId GetTypeId()
Get the type ID.
Definition
tcp-option-winscale.cc:32
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
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 Fri Nov 8 2024 13:59:01 for ns-3 by
1.11.0